summaryrefslogtreecommitdiff
path: root/lwlib
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2010-04-17 20:18:12 +0200
committerJan Djärv <jan.h.d@swipnet.se>2010-04-17 20:18:12 +0200
commit7aad87e884d84e136b57daee0506d85327be59df (patch)
treed3ebb097041ec00a71d0db1df80d3e96c5b51c55 /lwlib
parentf0bd159891705c30252646811a9be281e64e97c0 (diff)
downloademacs-7aad87e884d84e136b57daee0506d85327be59df.tar.gz
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.
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/ChangeLog2
-rw-r--r--lwlib/xlwmenu.c19
2 files changed, 21 insertions, 0 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 10993a80cfc..35cb646fbcb 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -24,6 +24,8 @@
(XlwMenuDestroy): Free pixmap. Call XtDestroyWidget instead of
XDestroyWindow.
(handle_motion_event): Only call handle_single_motion_event once.
+ (set_window_type): New function.
+ (make_windows_if_needed, XlwMenuRealize): Call set_window_type.
* xlwmenuP.h (window_state): Add pixmap and w.
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index b78d5075ef0..d396aa651e9 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -1315,6 +1315,23 @@ expose_cb (Widget widget,
}
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 @@ make_windows_if_needed (mw, n)
#ifdef HAVE_XFT
windows [i].xft_draw = 0;
#endif
+ set_window_type (windows [i].w, mw);
}
}
@@ -2039,6 +2057,7 @@ XlwMenuRealize (w, valueMask, attributes)
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