After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652102 - Issues when redrawing multiple GdkWindows
Issues when redrawing multiple GdkWindows
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-06-08 10:23 UTC by Andrea Cimitan
Modified: 2011-06-09 04:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test app for gtk+3 (10.12 KB, text/plain)
2011-06-08 10:23 UTC, Andrea Cimitan
Details
test app for gtk+2 (10.19 KB, text/plain)
2011-06-08 12:45 UTC, Andrea Cimitan
Details

Description Andrea Cimitan 2011-06-08 10:23:43 UTC
Created attachment 189459 [details]
test app for gtk+3

Hi,
I was having issues with animating my gdkwindow above the textview, so I started writing a complete test app and I came up with a weird behaviour:
To do many redraws on a gdkwindow, you need to apply a shape on it, if the window is over other gdkwindow, to redraw the intersection of the two windows you need to apply a shape on the gdkwindow below too. That means the shape seems to trigger something internally in gdk. Resetting the shape to NULL blocks the redrawings again.

In the test app (GTK+3), the window below (white) is not shaped at startup, while the above gdkwindow is: if you click on "Animate" you'll see the above window colorize in the external section outside the below window.
Then enable the shape on the window below with the check button, and re-click to Animate: the gdkwindow above is fully colourised.
Play with hiding the gdkwindow below to see the colouration works fine when there's just a gdkwindow above the toplevel. Removing the shape on the gdkwindow above blocks the colouration again.
Comment 1 Andrea Cimitan 2011-06-08 12:45:02 UTC
Created attachment 189465 [details]
test app for gtk+2

same test app, backported to gtk+ 2
Comment 2 Alexander Larsson 2011-06-08 12:54:35 UTC
This fixes it for me:

diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 0be4656..a643619 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -6546,6 +6546,8 @@ gdk_window_set_background_pattern (GdkWindow *window,
       GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
       impl_class->set_background (window, pattern);
     }
+  else
+    gdk_window_invalidate_rect_full (window, NULL, TRUE, CLEAR_BG_ALL);
 }
 
 /**
Comment 3 Benjamin Otte (Company) 2011-06-09 04:40:14 UTC
Pretty much pushed that fix to master and 2-24 branch now.