X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..21b6ad64da0993887ff33f7255f0939c55e2d4b8:/src/gtk1/frame.cpp diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 18d58ae61e..63af2106f8 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -23,7 +23,8 @@ #define XIconifyWindow XICONIFYWINDOW #endif -#include "wx/frame.h" +#include "wx/defs.h" + #include "wx/dialog.h" #include "wx/control.h" #include "wx/app.h" @@ -67,7 +68,8 @@ extern int g_openDialogs; #ifdef __WXUNIVERSAL__ IMPLEMENT_DYNAMIC_CLASS(wxFrameGTK, wxWindow) #else - IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) + IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxFrameGTK) + IMPLEMENT_DYNAMIC_CLASS(wxFrameGTK, wxWindow) #endif // ---------------------------------------------------------------------------- @@ -602,7 +604,7 @@ wxFrameGTK::~wxFrameGTK() } } -bool wxFrame::ShowFullScreen(bool show, long style ) +bool wxFrameGTK::ShowFullScreen(bool show, long style ) { if (show == m_fsIsShowing) return FALSE; // return what? @@ -1229,9 +1231,14 @@ void wxFrameGTK::Iconize( bool iconize ) { if (iconize) { - XIconifyWindow( GDK_WINDOW_XDISPLAY( m_widget->window ), - GDK_WINDOW_XWINDOW( m_widget->window ), - DefaultScreen( GDK_DISPLAY() ) ); + GdkWindow *window = m_widget->window; + + // you should do it later, for example from OnCreate() handler + wxCHECK_RET( window, _T("frame not created yet - can't iconize") ); + + XIconifyWindow( GDK_WINDOW_XDISPLAY( window ), + GDK_WINDOW_XWINDOW( window ), + DefaultScreen( GDK_DISPLAY() ) ); } } @@ -1240,22 +1247,12 @@ bool wxFrameGTK::IsIconized() const return m_isIconized; } -void wxFrame::SetIconizeState(bool iconize) +void wxFrameGTK::SetIconizeState(bool iconize) { if ( iconize != m_isIconized ) { m_isIconized = iconize; (void)SendIconizeEvent(iconize); } - else - { - // this is not supposed to happen if we're called only from - // gtk_frame_(un)map_callback! - - // RR: I don't understand this test. Upon startup, the frame is - // not iconized by default, it has just not been created - // yet. - ///wxFAIL_MSG( _T("unexpected call to SendIconizeEvent ignored") ); - } }