Mercurial > emacs
changeset 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 | 948294352a25 |
children | 3a236df3a739 |
files | lwlib/ChangeLog lwlib/xlwmenu.c |
diffstat | 2 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lwlib/ChangeLog Sat Apr 17 19:49:18 2010 +0200 +++ b/lwlib/ChangeLog Sat Apr 17 20:18:12 2010 +0200 @@ -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.
--- 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