From 4eda5b6b0616baa6ced2aaac73c6c1397f8c08e7 Mon Sep 17 00:00:00 2001 From: gotmor Date: Sat, 28 Mar 2009 04:05:37 +0000 Subject: set WM_CLASS hint to "dzen2" "dzen" set _NET_WM_STATE_STICKY and _NET_WM_STATE_ABOVE git-svn-id: http://dzen.googlecode.com/svn/trunk@260 f2baff5b-bf2c-0410-a398-912abdc3d8b2 --- main.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index a5ed9e1..a66bf26 100644 --- a/main.c +++ b/main.c @@ -367,7 +367,6 @@ set_docking_ewmh_info(Display *dpy, Window w, int dock) { if(dock) { type = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False); - XChangeProperty( dpy, w, @@ -379,8 +378,33 @@ set_docking_ewmh_info(Display *dpy, Window w, int dock) { 1 ); - desktop = 0xffffffff; + /* some window managers honor this properties*/ + type = XInternAtom(dpy, "_NET_WM_STATE_ABOVE", False); + XChangeProperty( + dpy, + w, + XInternAtom(dpy, "_NET_WM_STATE", False), + XInternAtom(dpy, "ATOM", False), + 32, + PropModeReplace, + (unsigned char *)&type, + 1 + ); + type = XInternAtom(dpy, "_NET_WM_STATE_STICKY", False); + XChangeProperty( + dpy, + w, + XInternAtom(dpy, "_NET_WM_STATE", False), + XInternAtom(dpy, "ATOM", False), + 32, + PropModeAppend, + (unsigned char *)&type, + 1 + ); + + + desktop = 0xffffffff; XChangeProperty( dpy, w, @@ -447,6 +471,7 @@ x_create_windows(int use_ewmh_dock) { Window root; int i; XRectangle si; + XClassHint *class_hint; root = RootWindow(dzen.dpy, dzen.screen); @@ -477,6 +502,14 @@ x_create_windows(int use_ewmh_dock) { DefaultDepth(dzen.dpy, dzen.screen), CopyFromParent, DefaultVisual(dzen.dpy, dzen.screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); + /* set class property */ + class_hint = XAllocClassHint(); + class_hint->res_name = "dzen2"; + class_hint->res_class = "dzen"; + XSetClassHint(dzen.dpy, dzen.title_win.win, class_hint); + XFree(class_hint); + + /* title */ XStoreName(dzen.dpy, dzen.title_win.win, dzen.title_win.name); dzen.title_win.drawable = XCreatePixmap(dzen.dpy, root, dzen.title_win.width, -- cgit v1.2.3-54-g00ecf