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 757856 - Fix coordinate space for GtkTextView layers
Fix coordinate space for GtkTextView layers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-11-09 21:27 UTC by Alexander Larsson
Modified: 2015-11-10 07:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
TextView: Use saner coordinate space in draw_layer. (3.75 KB, patch)
2015-11-09 21:27 UTC, Alexander Larsson
none Details | Review
TextView: Use saner coordinate space in draw_layer. (4.49 KB, patch)
2015-11-10 07:39 UTC, Alexander Larsson
none Details | Review

Description Alexander Larsson 2015-11-09 21:27:04 UTC
This is currently weird, as manifested by the widget factory demo being broken.
Comment 1 Alexander Larsson 2015-11-09 21:27:29 UTC
Created attachment 315156 [details] [review]
TextView: Use saner coordinate space in draw_layer.

When I added the draw_layer vfunc it accidentally got passed a cairo_t
that was configured with to draw in the viewport coordinate space (rather
than the buffer coordinate space). This makes things unnecessary complex,
because you have to convert between the two.

The pixel cache is shared between the text and the layers, so there is
no way to use draw_layer to get a stationary overlay effect. Thus it makes
much more sense for the draw_layer vfunc to draw in the buffer space.

Just changing this would break ABI for existing code, so this is fixed
by adding new layer types and deprecating the old ones.

Also, we use the new layer types to fix gtk3-widget-factory.
Comment 2 Matthias Clasen 2015-11-09 21:34:33 UTC
I like this better. Would be good if the docs said something about coordinates
Comment 3 Alexander Larsson 2015-11-10 07:39:49 UTC
Created attachment 315172 [details] [review]
TextView: Use saner coordinate space in draw_layer.

When I added the draw_layer vfunc it accidentally got passed a cairo_t
that was configured with to draw in the viewport coordinate space (rather
than the buffer coordinate space). This makes things unnecessary complex,
because you have to convert between the two.

The pixel cache is shared between the text and the layers, so there is
no way to use draw_layer to get a stationary overlay effect. Thus it makes
much more sense for the draw_layer vfunc to draw in the buffer space.

Just changing this would break ABI for existing code, so this is fixed
by adding new layer types and deprecating the old ones.

Also, we use the new layer types to fix gtk3-widget-factory.
Comment 4 Alexander Larsson 2015-11-10 07:41:28 UTC
Attachment 315172 [details] pushed as 0af4576 - TextView: Use saner coordinate space in draw_layer.