virtual void SetIcon(const wxIcon& icon);
virtual void Restore();
- virtual bool Show(bool show = TRUE);
+ virtual bool Show( bool show = TRUE );
- virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
+ virtual bool ShowFullScreen( bool show, long style = wxFULLSCREEN_ALL );
virtual bool IsFullScreen() const { return m_fsIsShowing; }
virtual void SetTitle( const wxString& title);
virtual wxString GetTitle() const;
- // implementation from now on
- // --------------------------
+ // implementation
+ void SetNeedResizeInIdle( bool set = TRUE ) { m_needResizeInIdle = set; }
- void SetFocusWidget( wxWindow *focus ) { m_focusWidget = focus; }
- wxWindow *GetFocusWidget() const { return m_focusWidget; }
-
protected:
// common part of all ctors
void Init();
- // For implementation purposes - sometimes decorations make the client area
- // smaller
+ // For implementation purposes - sometimes decorations make the
+ // client area smaller
virtual wxPoint GetClientAreaOrigin() const;
+ // For implementation of delayed resize events
+ bool m_needResizeInIdle;
+ virtual void OnInternalIdle();
+
virtual void DoGetClientSize( int *width, int *height ) const;
virtual void DoSetClientSize(int width, int height);
virtual void DoSetSize(int x, int y,
bool m_fsIsMaximized;
bool m_fsIsShowing;
wxString m_title;
-
- // This widget gets the key input
- wxWindow* m_focusWidget;
};
// list of all frames and modeless dialogs
#endif
{
//wxLogDebug("ConfigureNotify: %s", windowClass.c_str());
- wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() );
- sizeEvent.SetEventObject( win );
+ if (win->IsTopLevel())
+ {
+ wxTopLevelWindowX11 *tlw = (wxTopLevelWindowX11 *) win;
+ tlw->SetNeedResizeInIdle();
+ }
+ else
+ {
+ wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() );
+ sizeEvent.SetEventObject( win );
- return win->GetEventHandler()->ProcessEvent( sizeEvent );
+ return win->GetEventHandler()->ProcessEvent( sizeEvent );
+ }
}
return FALSE;
break;
m_fsIsMaximized = FALSE;
m_fsIsShowing = FALSE;
- m_focusWidget = NULL;
+ m_needResizeInIdle = FALSE;
}
bool wxTopLevelWindowX11::Create(wxWindow *parent,
}
}
+void wxTopLevelWindowX11::OnInternalIdle()
+{
+ wxWindow::OnInternalIdle();
+
+ if (m_needResizeInIdle)
+ {
+ wxSizeEvent event( GetClientSize(), GetId() );
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( event );
+ }
+}
+
// ----------------------------------------------------------------------------
// wxTopLevelWindowX11 showing
// ----------------------------------------------------------------------------
// 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);
}
-#endif
return wxWindowX11::Show(show);
}