set extended wm hint _NET_WM_WINDOW_TYPE to _UTILITY
authorPhilip Kovacs <pkovacs@users.sourceforge.net>
Thu, 26 Jan 2006 01:27:41 +0000 (01:27 +0000)
committerPhilip Kovacs <pkovacs@users.sourceforge.net>
Thu, 26 Jan 2006 01:27:41 +0000 (01:27 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@509 7f574dfc-610e-0410-a909-a81674777703

src/x11.c

index a7f69b2..7860f6f 100644 (file)
--- a/src/x11.c
+++ b/src/x11.c
@@ -250,16 +250,32 @@ void init_window(int own_window, int w, int h, int l, int set_trans, int back_co
                                                (unsigned char *) &prop,
                                                1);
                        }
+
+                       /* PHK: Set EWMH _NET_WM_WINDOW_TYPE to _NET_WM_WINDOW_TYPE_UTILITY. 
+                           This addresses the issue where conky can disappear under the desktop
+                           while running in its own window with property on_bottom=yes and the 
+                           desktop gets raised over it.  As a utility window, this wont happen. 
+                        */
+                       a = XInternAtom(display, "_NET_WM_WINDOW_TYPE", True);
+                       if (a != None) {
+                               Atom prop = XInternAtom(display, "_NET_WM_WINDOW_TYPE_UTILITY", True);
+                               XChangeProperty(display, window.window, a,
+                                               XA_ATOM, 32,
+                                               PropModeReplace,
+                                               (unsigned char *) &prop,
+                                               1);
+                       }
+
                        if(l) {
-                       /* make sure the layer is on the bottom */
-         a = XInternAtom(display, "_WIN_LAYER", True);
-         if (a != None) {
-            long prop = 0;
-            XChangeProperty(display, window.window, a,
-            XA_CARDINAL, 32,
-            PropModeReplace,
-            (unsigned char *) &prop, 1);
-         }
+                               /* make sure the layer is on the bottom */
+                               a = XInternAtom(display, "_WIN_LAYER", True);
+                               if (a != None) {
+                                       long prop = 0;
+                                       XChangeProperty(display, window.window, a,
+                                                       XA_CARDINAL, 32,
+                                                       PropModeReplace,
+                                                       (unsigned char *) &prop, 1);
+                               }
                        }
                }