diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 1cda4f11ba..29ecd4b3fe 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3627,6 +3627,16 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) #ifndef __WXGTK20__ if (g_isIdle) wxapp_install_idle_handler(); + wxRect myRect (0, 0, m_wxwindow->allocation.width, + m_wxwindow->allocation.height); + + if (rect){ + myRect.Intersect(*rect); + if (!myRect.width || !myRect.height) + // nothing to do, rectangle is empty + return; + rect = &myRect; + } if (eraseBackground && m_wxwindow && m_wxwindow->window) { diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 1cda4f11ba..29ecd4b3fe 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -3627,6 +3627,16 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect ) #ifndef __WXGTK20__ if (g_isIdle) wxapp_install_idle_handler(); + wxRect myRect (0, 0, m_wxwindow->allocation.width, + m_wxwindow->allocation.height); + + if (rect){ + myRect.Intersect(*rect); + if (!myRect.width || !myRect.height) + // nothing to do, rectangle is empty + return; + rect = &myRect; + } if (eraseBackground && m_wxwindow && m_wxwindow->window) {