]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed Refresh to clip update rectangles to the visible area of a
authorStefan Neis <Stefan.Neis@t-online.de>
Mon, 9 Jun 2003 18:27:31 +0000 (18:27 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Mon, 9 Jun 2003 18:27:31 +0000 (18:27 +0000)
        (scrolled) window. If there are many invisible/partly visible
        rectangles in the update region GTK+-1.2.10 starts complaining
        about bad match errors and soon crashes.
Change corresponds to changes on WX_2_4_BRANCH from 1.408.2.21 to 1.408.2.24.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp
src/gtk1/window.cpp

index ca83cf7c87e437426aa89a9b2df87fae57085612..7339c08f0796ea757facaaa25da112f52e1737d9 100644 (file)
@@ -3605,6 +3605,18 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect )
     if (g_isIdle)
         wxapp_install_idle_handler();
 
+    wxRect myRect(0,0,0,0);
+    if (m_wxwindow && rect)
+    {
+        myRect.SetSize(wxSize( m_wxwindow->allocation.width,
+                               m_wxwindow->allocation.height));
+        myRect.Intersect(*rect);
+        if (!myRect.width || !myRect.height)
+            // nothing to do, rectangle is empty
+            return;
+        rect = &myRect;
+    }
+
     if (eraseBackground && m_wxwindow && m_wxwindow->window)
     {
         if (rect)
index ca83cf7c87e437426aa89a9b2df87fae57085612..7339c08f0796ea757facaaa25da112f52e1737d9 100644 (file)
@@ -3605,6 +3605,18 @@ void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect )
     if (g_isIdle)
         wxapp_install_idle_handler();
 
+    wxRect myRect(0,0,0,0);
+    if (m_wxwindow && rect)
+    {
+        myRect.SetSize(wxSize( m_wxwindow->allocation.width,
+                               m_wxwindow->allocation.height));
+        myRect.Intersect(*rect);
+        if (!myRect.width || !myRect.height)
+            // nothing to do, rectangle is empty
+            return;
+        rect = &myRect;
+    }
+
     if (eraseBackground && m_wxwindow && m_wxwindow->window)
     {
         if (rect)