From 307be31a92ef859183711d3836bf67c3db5cc7da Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 14 Feb 2002 12:07:54 +0000 Subject: [PATCH] Added border for top level windows with captions, though 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 | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index a8842012bf..68e4ef5aa3 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -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;