GNOME Bugzilla – Bug 793194
gdk_window_shape_combine_region() doesn't work on GTK3.10+
Last modified: 2018-05-02 19:50:09 UTC
Created attachment 367924 [details] Sample snippet to reproduce the issue I am trying to change the shape of a GtkButton widget using a cairo region and gdk_window_shape_combine_region(). On GTK3.8 this worked fine. However as of GTK3.10+ it no longer works as expected. I bisected and found the commit that broke it: https://github.com/GNOME/gtk/commit/d22fd7223c75f4720ddb982c659efb0d8d7543c4 I've attached a sample snippet, including our custom container. Just extract the archive, make, and then run the snippet "simple_button_app". On 3.10+ the button is fully visible but the area that should be obscured is not clickable. This affects both the Wayland and X11 backends. I've found a workaround whereby I call gdk_window_ensure_native() before gdk_window_shape_combine_region() -- this works on X11. On Wayland it makes the whole button transparent, so I'm not sure this workaround is a good one.
Are you able to distill this down to a minimal, single-file example? i.e. does the report depend on your SwtFixed widget in any way, or can you demonstrate it without that?
Created attachment 369869 [details] Pure GTK snippet (no custom container) (In reply to Daniel Boles from comment #1) > Are you able to distill this down to a minimal, single-file example? i.e. > does the report depend on your SwtFixed widget in any way, or can you > demonstrate it without that? Yes, I've attached a snippet. I did speak to Benjamin about this issue on IRC and he said it's basically WONTFIX, as the bug stems from a fundamental change in the drawing model. I've worked around the issue by using cairo_clip(), but that doesn't solve the problem of the input handling: clicking the button in the shaped region shouldn't trigger events like "clicked" (this was the behaviour on GTK3.8). I don't mind using cairo_clip(), but if there are any suggestions on how to block the input handling I would love to hear them. :)
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/1026.