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 710958 - Problem with very large window
Problem with very large window
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-10-27 09:35 UTC by Damon Chaplin
Modified: 2013-10-28 10:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkWidget: Fix clipping to large subwindows (2.05 KB, patch)
2013-10-28 10:35 UTC, Alexander Larsson
none Details | Review
GtkWidget: Fix clipping to large subwindows (2.19 KB, patch)
2013-10-28 10:56 UTC, Alexander Larsson
committed Details | Review

Description Damon Chaplin 2013-10-27 09:35:49 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.)
Comment 1 Alexander Larsson 2013-10-28 10:35:42 UTC
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.
Comment 2 Alexander Larsson 2013-10-28 10:56:08 UTC
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.
Comment 3 Alexander Larsson 2013-10-28 10:57:37 UTC
Attachment 258287 [details] pushed as 864f7f7 - GtkWidget: Fix clipping to large subwindows