diff lwlib/xlwmenu.c @ 107888:32fc68b9d103

Set _NET_WM_WINDOW_TYPE in menus. Looks bad with compiz otherwise. xlwmenu.c (set_window_type): New function. (make_windows_if_needed, XlwMenuRealize): Call set_window_type.
author Jan D. <jan.h.d@swipnet.se>
date Sat, 17 Apr 2010 20:18:12 +0200
parents 9a798edc503b
children 150fd3d78f5a
line wrap: on
line diff
--- a/lwlib/xlwmenu.c	Sat Apr 17 19:49:18 2010 +0200
+++ b/lwlib/xlwmenu.c	Sat Apr 17 20:18:12 2010 +0200
@@ -1315,6 +1315,23 @@
 }
 
 static void
+set_window_type (Widget w, XlwMenuWidget mw)
+{
+  int popup_menu_p = mw->menu.top_depth == 1;
+  Atom type = XInternAtom (XtDisplay (w),
+                           popup_menu_p
+                           ? "_NET_WM_WINDOW_TYPE_POPUP_MENU"
+                           : "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
+                           False);
+
+  XChangeProperty (XtDisplay (w), XtWindow (w),
+                   XInternAtom (XtDisplay (w), "_NET_WM_WINDOW_TYPE", False),
+                   XA_ATOM, 32, PropModeReplace,
+                   (unsigned char *)&type, 1);
+}
+
+
+static void
 make_windows_if_needed (mw, n)
      XlwMenuWidget mw;
      int n;
@@ -1372,6 +1389,7 @@
 #ifdef HAVE_XFT
      windows [i].xft_draw = 0;
 #endif
+     set_window_type (windows [i].w, mw);
    }
 }
 
@@ -2039,6 +2057,7 @@
   mw->menu.windows [0].width = w->core.width;
   mw->menu.windows [0].height = w->core.height;
 
+  set_window_type (mw->menu.windows [0].w, mw);
   create_pixmap_for_menu (&mw->menu.windows [0], mw);
 
 #ifdef HAVE_XFT