GNOME Bugzilla – Bug 652102
Issues when redrawing multiple GdkWindows
Last modified: 2011-06-09 04:40:14 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.
Created attachment 189465 [details] test app for gtk+2 same test app, backported to gtk+ 2
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); } /**
Pretty much pushed that fix to master and 2-24 branch now.