X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/977a41ec3e85ae7736b7028ec04ebd1818058c8e..01b5ad3b500627ae3ebadc755f47c816a859e6bb:/src/gtk/toplevel.cpp?ds=sidebyside diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index f17d3e2257..3bac808b96 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -442,6 +442,7 @@ void wxTopLevelWindowGTK::Init() m_gdkFunc = 0; m_grabbed = false; m_deferShow = true; + m_deferShowAllowed = true; m_updateDecorSize = true; m_urgency_hint = -2; @@ -661,7 +662,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK() if (m_grabbed) { - wxFAIL_MSG(_T("Window still grabbed")); + wxFAIL_MSG(wxT("Window still grabbed")); RemoveGrab(); } @@ -776,11 +777,21 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long) // overridden wxWindow methods // ---------------------------------------------------------------------------- +void wxTopLevelWindowGTK::Refresh( bool WXUNUSED(eraseBackground), const wxRect *WXUNUSED(rect) ) +{ + wxCHECK_RET( m_widget, wxT("invalid frame") ); + + gtk_widget_queue_draw( m_widget ); + + if (m_wxwindow && m_wxwindow->window) + gdk_window_invalidate_rect( m_wxwindow->window, NULL, TRUE ); +} + bool wxTopLevelWindowGTK::Show( bool show ) { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); - bool deferShow = show && !m_isShown && m_deferShow; + bool deferShow = show && !m_isShown && m_deferShow && m_deferShowAllowed; if (deferShow) { deferShow = false; @@ -896,6 +907,8 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si { wxCHECK_RET( m_widget, wxT("invalid frame") ); + m_deferShowAllowed = true; + // deal with the position first int old_x = m_x; int old_y = m_y; @@ -940,9 +953,9 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si void wxTopLevelWindowGTK::DoSetClientSize(int width, int height) { - if (m_deferShow && !m_isShown) - // Since client size is being explicitly set, don't change it later - m_deferShow = false; + // Since client size is being explicitly set, don't change it later + m_deferShowAllowed = false; + wxTopLevelWindowBase::DoSetClientSize(width, height); } @@ -1217,7 +1230,7 @@ static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region) bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) { wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, - _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); + wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); if ( GTK_WIDGET_REALIZED(m_widget) ) {