ecere/gui/drivers/XInterface: Improved setting _NET_WINDOW_TYPE
authorJerome St-Louis <jerome@ecere.com>
Wed, 12 Feb 2014 22:44:56 +0000 (07:44 +0900)
committerJerome St-Louis <jerome@ecere.com>
Wed, 12 Feb 2014 22:44:56 +0000 (07:44 +0900)
- Using DROPDOWN_MENU rather than POPUP_MENU
- Owner window title bar still flickers acitve/inactive on popup menus
- Can't set DIALOG because it causes the close boxes to go away

ecere/src/gui/drivers/XInterface.ec

index 09a363e..94c2ff0 100644 (file)
@@ -2454,18 +2454,32 @@ class XInterface : Interface
             }
 
             {
-               Atom hints[2] =
+               Atom hints[4];
+               int count;
+               if(parentWindow && window.interim)
+               {
+                  hints[0] = atoms[_net_wm_window_type_dropdown_menu];
+                  hints[1] = atoms[_net_wm_window_type_popup_menu];
+                  hints[2] = atoms[_net_wm_window_type_menu];
+                  count = 3;
+               }
+               else if(parentWindow)
+               {
+                  hints[0] = atoms[_net_wm_window_type_normal];
+
+                  // Some WMs won't show a close button if dialog is set
+                  // Additionally, this casues jumping of all dialog windows on Cinnamon
+                  //hints[0] = atoms[_net_wm_window_type_dialog];
+                  count = 1;
+               }
+               else
                {
-                  parentWindow ? atoms[_net_wm_window_type_menu] : atoms[_net_wm_window_type_normal],
-                  parentWindow ? atoms[_net_wm_window_type_popup_menu] : 0
+                  hints[0] = atoms[_net_wm_window_type_normal];
+                  count = 1;
                };
-#if defined(__APPLE__) || defined(__FreeBSD__)
-               // Don't set this on non-interim windows for OS X...
-               if(parentWindow && window.interim)
-#endif
+               XChangeProperty(xGlobalDisplay, windowHandle, atoms[_net_wm_window_type], XA_ATOM, 32,
+                  PropModeReplace, (unsigned char*)&hints, count);
 
-                  XChangeProperty(xGlobalDisplay, windowHandle, atoms[_net_wm_window_type], XA_ATOM, 32,
-                     PropModeReplace, (unsigned char*)&hints, parentWindow ? 2 : 1);
                {
                   XWMHints xwmHints;
                   xwmHints.flags = InputHint;