]> git.saurik.com Git - wxWidgets.git/commitdiff
Added border for top level windows with captions, though
authorJulian Smart <julian@anthemion.co.uk>
Thu, 14 Feb 2002 12:07:54 +0000 (12:07 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 14 Feb 2002 12:07:54 +0000 (12:07 +0000)
this does seem to make it resizable also. Sizing of about dialog
wrong at present.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/toplevel.cpp

index a8842012bfe9530b90c5416919b97236e6213dce..68e4ef5aa3daa18759cc24872422244946787c5b 100644 (file)
@@ -111,20 +111,6 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
     // I think we set this to True to remove decorations
     xattributes.override_redirect = False;
     
-    Window xwindow = XCreateWindow( xdisplay, xparent, pos.x, pos.y, size.x, size.y, 
-       0, DefaultDepth(xdisplay,xscreen), InputOutput, xvisual, xattributes_mask, &xattributes );
-    m_mainWidget = (WXWindow) xwindow;
-
-    XSelectInput( xdisplay, xwindow,
-        ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
-        ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask |
-        KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
-        PropertyChangeMask );
-
-    wxAddWindowToTable( xwindow, (wxWindow*) this );
-    
-    XSetTransientForHint( xdisplay, xwindow, xparent );
-
     wxSize size2(size);
     if (size2.x == -1)
        size2.x = 100;
@@ -137,6 +123,21 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
     if (pos2.y == -1)
        pos2.y = 100;
     
+    Window xwindow = XCreateWindow( xdisplay, xparent, pos2.x, pos2.y, size2.x, size2.y, 
+       0, DefaultDepth(xdisplay,xscreen), InputOutput, xvisual, xattributes_mask, &xattributes );
+    m_mainWidget = (WXWindow) xwindow;
+
+    XSelectInput( xdisplay, xwindow,
+        ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
+        ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask |
+        KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
+        PropertyChangeMask );
+
+    wxAddWindowToTable( xwindow, (wxWindow*) this );
+
+    // Messes up window management
+    //    XSetTransientForHint( xdisplay, xwindow, xparent );
+
     size_hints.flags = PSize;
     size_hints.width = size2.x;
     size_hints.height = size2.y;
@@ -153,7 +154,6 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
     wxSetWMDecorations((Window) GetMainWindow(), style);
 
     SetTitle(title);
-    SetSize(pos2.x, pos2.y, size2.x, size2.y);
     
     return TRUE;
 }
@@ -370,7 +370,7 @@ bool wxSetWMDecorations(Window w, long style)
         hints.decorations |= MWM_DECOR_TITLE;
     }
 
-    if (style & wxTHICK_FRAME)
+    if ((style & wxTHICK_FRAME) || (style & wxSIMPLE_BORDER) || (style & wxCAPTION))
     {
        wxLogDebug("MWM_DECOR_BORDER");
         hints.flags |= MWM_HINTS_DECORATIONS;