GNOME Bugzilla – Bug 710958
Problem with very large window
Last modified: 2013-10-28 10:57:41 UTC
The GooCanvas "Large Items" page in the demo doesn't work with GTK+ 3.10 - the canvas isn't drawn at all. It uses a very large window, up to the limits of a GdkWindow (signed 32-bit int). If I change the window coords (in demo/demo-large-items.c) from +/-107374182 to +/-4194235 it works OK. It looks like gtk_cairo_should_draw_window() is returning FALSE when the window is very large. If I skip that call it seems to draw fine. (Of course this is just a demo, so isn't absolutely vital.)
Created attachment 258285 [details] [review] GtkWidget: Fix clipping to large subwindows _gtk_widget_draw_internal() was clipping by passing the subwindow sizes as a path to cairo_clip(). This was breaking for windows larger than 23 bits in width/height, probably due to cairo internals being 24.8 fixed point. We fix this by pre-clipping the subwindow region with the existing cairo clip region in the full 32bit gdkwindow precision. This fixes the GooCanvas Large Items test.
Created attachment 258287 [details] [review] GtkWidget: Fix clipping to large subwindows _gtk_widget_draw_internal() was clipping by passing the subwindow sizes as a path to cairo_clip(). This was breaking for windows larger than 23 bits in width/height, due to cairo using fixed point (24.8) for the path coordinates. We fix this by pre-clipping the subwindow region to the existing cairo clip region in the full 32bit gdkwindow precision. This fixes the GooCanvas Large Items test.
Attachment 258287 [details] pushed as 864f7f7 - GtkWidget: Fix clipping to large subwindows