// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "toplevel.h"
#endif
xattributes.override_redirect = True;
}
- if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ))
+ if (!HasFlag( wxFULL_REPAINT_ON_RESIZE ))
{
xattributes_mask |= CWBitGravity;
xattributes.bit_gravity = NorthWestGravity;
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);
{
wxWindow::OnInternalIdle();
- if (m_needResizeInIdle)
+ // Do this only after the last idle event so that
+ // all windows have been updated before a new
+ // round of size events is sent
+ if (m_needResizeInIdle && !wxTheApp->Pending())
{
wxSizeEvent event( GetClientSize(), GetId() );
event.SetEventObject( this );
bool wxTopLevelWindowX11::Show(bool show)
{
- // Nano-X has to force a size event,
- // else there's no initial size.
-#if wxUSE_NANOX
if (show)
-#else
- if (show && m_needResizeInIdle)
-#endif
{
wxSizeEvent event(GetSize(), GetId());
+
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
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();
- }
- }
bool ret = wxWindowX11::Show(show);
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
}
}
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 ;
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)
{