]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/toplevel.cpp
hide tree root on wxMSW in wxHtmlHelpController
[wxWidgets.git] / src / x11 / toplevel.cpp
index 2fef702902d05c22284e6451d64ba8d3bf504d87..9be69bcdad2adfe78ca49c5bbf27b38246e1beae 100644 (file)
@@ -127,7 +127,9 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
     // TODO: if we want no border, caption etc.,
     // I think we set this to True to remove decorations
     // No. RR.
-    xattributes.override_redirect = False;
+    // Yes :-) JACS (because some WMs don't respect
+    // the hints)
+    xattributes.override_redirect = (style & wxNO_BORDER) ? True : False;
 #endif
     
 #if wxUSE_NANOX
@@ -199,6 +201,24 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
     wm_protocols[0] = XInternAtom( xdisplay, "WM_DELETE_WINDOW", False );
     wm_protocols[1] = XInternAtom( xdisplay, "WM_TAKE_FOCUS", False );
     XSetWMProtocols( xdisplay, xwindow, wm_protocols, 2);
+
+#if 0 // TODO
+    // You will need a compliant window manager for this to work
+    // (e.g. sawfish/enlightenment/kde/icewm/windowmaker)
+    if (style & wxSTAY_ON_TOP)
+    {
+        CARD32 data = 4; // or should this be 6? According to http://developer.gnome.org/doc/standards/wm/c44.html
+        XChangeProperty (xdisplay,
+                    xwindow,
+                    XInternAtom (xdisplay, "_WIN_LAYER", False),
+                    XA_CARDINAL,
+                    32,
+                    PropModeReplace,
+                    (unsigned char *)&data,
+                    1);
+    }
+#endif
+
 #endif
     
     wxSetWMDecorations( xwindow, style);
@@ -260,6 +280,18 @@ bool wxTopLevelWindowX11::Show(bool show)
         m_needResizeInIdle = FALSE;
     }
 
+    if (show)
+    {
+        // This does the layout _before_ the
+        // window is shown, else the items are
+        // drawn first at the wrong positions,
+        // then at the correct positions.
+        if (GetAutoLayout())
+        {
+            Layout();
+        }
+    }
+
     return wxWindowX11::Show(show);
 }