gdk_window_shape_combine_region() doesn't work on GTK3.10+
Submitted by Eric Williams
Link to original bug (#793194)
Description
Created attachment 367924 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.
Attachment 367924, "Sample snippet to reproduce the issue":
simple_button_app.tar.gz
Version: 3.22.x