X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/193e19cfdfc0506d9ddc19b3532d340fd7421bae..f9a2692dbe8db32938121899073abef4d07dee13:/src/x11/toplevel.cpp diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index c9babe3825..7ac9f69372 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "toplevel.h" #endif @@ -139,7 +139,7 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent, xattributes.override_redirect = True; } - if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE )) + if (!HasFlag( wxFULL_REPAINT_ON_RESIZE )) { xattributes_mask |= CWBitGravity; xattributes.bit_gravity = NorthWestGravity; @@ -248,7 +248,7 @@ wxTopLevelWindowX11::~wxTopLevelWindowX11() wxTopLevelWindows.DeleteObject(this); // If this is the last top-level window, exit. - if ( wxTheApp && (wxTopLevelWindows.Number() == 0) ) + if ( wxTheApp && (wxTopLevelWindows.GetCount() == 0) ) { wxTheApp->SetTopWindow(NULL); @@ -404,16 +404,31 @@ void wxTopLevelWindowX11::SetIcons(const wxIconBundle& icons ) wxSetIconsX11( wxGlobalDisplay(), GetMainWindow(), icons ); } +bool wxTopLevelWindowX11::SetShape(const wxRegion& region) +{ + return wxDoSetShape( wxGlobalDisplay(), + (Window)GetMainWindow(), + region ); +} + void wxTopLevelWindowX11::SetTitle(const wxString& title) { m_title = title; if (GetMainWindow()) { +#if wxUSE_UNICODE + // I wonder of e.g. Metacity takes UTF-8 here + XStoreName(wxGlobalDisplay(), (Window) GetMainWindow(), + (const char*) title.ToAscii() ); + XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(), + (const char*) title.ToAscii() ); +#else XStoreName(wxGlobalDisplay(), (Window) GetMainWindow(), (const char*) title); XSetIconName(wxGlobalDisplay(), (Window) GetMainWindow(), (const char*) title); +#endif } } @@ -654,7 +669,7 @@ struct MwmHints { #define PROP_MOTIF_WM_HINTS_ELEMENTS 5 // Set the window manager decorations according to the -// given wxWindows style +// given wxWidgets style bool wxSetWMDecorations(Window w, long style) { #if wxUSE_NANOX @@ -669,7 +684,7 @@ bool wxSetWMDecorations(Window w, long style) wmProp.flags |= GR_WM_FLAGS_PROPS ; } - if (style & wxSYSTEM_MENU) + if (style & wxCLOSE_BOX) { wmProp.props |= GR_WM_PROPS_CLOSEBOX ; wmProp.flags |= GR_WM_FLAGS_PROPS ; @@ -743,10 +758,10 @@ bool wxSetWMDecorations(Window w, long style) hints.decorations |= MWM_DECOR_TITLE; if ((style & wxSYSTEM_MENU) != 0) - { - hints.functions |= MWM_FUNC_CLOSE; hints.decorations |= MWM_DECOR_MENU; - } + + if ((style & wxCLOSE_BOX) != 0) + hints.functions |= MWM_FUNC_CLOSE; if ((style & wxMINIMIZE_BOX) != 0) {