comparison 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
comparison
equal deleted inserted replaced
107887:948294352a25 107888:32fc68b9d103
1313 if (i < mw->menu.windows_length && i < mw->menu.old_depth) 1313 if (i < mw->menu.windows_length && i < mw->menu.old_depth)
1314 display_menu (mw, i, False, NULL, NULL, NULL, NULL, NULL); 1314 display_menu (mw, i, False, NULL, NULL, NULL, NULL, NULL);
1315 } 1315 }
1316 1316
1317 static void 1317 static void
1318 set_window_type (Widget w, XlwMenuWidget mw)
1319 {
1320 int popup_menu_p = mw->menu.top_depth == 1;
1321 Atom type = XInternAtom (XtDisplay (w),
1322 popup_menu_p
1323 ? "_NET_WM_WINDOW_TYPE_POPUP_MENU"
1324 : "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
1325 False);
1326
1327 XChangeProperty (XtDisplay (w), XtWindow (w),
1328 XInternAtom (XtDisplay (w), "_NET_WM_WINDOW_TYPE", False),
1329 XA_ATOM, 32, PropModeReplace,
1330 (unsigned char *)&type, 1);
1331 }
1332
1333
1334 static void
1318 make_windows_if_needed (mw, n) 1335 make_windows_if_needed (mw, n)
1319 XlwMenuWidget mw; 1336 XlwMenuWidget mw;
1320 int n; 1337 int n;
1321 { 1338 {
1322 int i; 1339 int i;
1370 windows [i].window = XtWindow (windows [i].w); 1387 windows [i].window = XtWindow (windows [i].w);
1371 windows [i].pixmap = None; 1388 windows [i].pixmap = None;
1372 #ifdef HAVE_XFT 1389 #ifdef HAVE_XFT
1373 windows [i].xft_draw = 0; 1390 windows [i].xft_draw = 0;
1374 #endif 1391 #endif
1392 set_window_type (windows [i].w, mw);
1375 } 1393 }
1376 } 1394 }
1377 1395
1378 /* Value is non-zero if WINDOW is part of menu bar widget W. */ 1396 /* Value is non-zero if WINDOW is part of menu bar widget W. */
1379 1397
2037 mw->menu.windows [0].x = w->core.x; 2055 mw->menu.windows [0].x = w->core.x;
2038 mw->menu.windows [0].y = w->core.y; 2056 mw->menu.windows [0].y = w->core.y;
2039 mw->menu.windows [0].width = w->core.width; 2057 mw->menu.windows [0].width = w->core.width;
2040 mw->menu.windows [0].height = w->core.height; 2058 mw->menu.windows [0].height = w->core.height;
2041 2059
2060 set_window_type (mw->menu.windows [0].w, mw);
2042 create_pixmap_for_menu (&mw->menu.windows [0], mw); 2061 create_pixmap_for_menu (&mw->menu.windows [0], mw);
2043 2062
2044 #ifdef HAVE_XFT 2063 #ifdef HAVE_XFT
2045 if (mw->menu.xft_font) 2064 if (mw->menu.xft_font)
2046 { 2065 {