[Wayland] Region passed to gdk_window_input_shape_combine_region gets lost after hiding and showing the window again
Steps to reproduce
- When working on https://bugzilla.mozilla.org/show_bug.cgi?id=1725604, I realized that the input region set via
gdk_window_input_shape_combine_region
gets lost on wayland after toggling visibility. - Here's a test program that reproduces the issue, compiled with
cc t.c $(pkg-config --cflags gtk+-3.0 --libs)
. The popup window starts as opaque (clicking the button on it works). After clicking "Toggle input region", the clicks are expected to go to the button under it. After clicking "Toggle window" twice, that is expected to still happen. - On Wayland, toggling input region doesn't update immediately. I need to click "toggle window" to get the expected behavior. Clicking "toggle window" twice again loses the input region.
- x11 behaves as expected, preserving the input region across visibility toggling, and updating the input region without further action needed.
Expected outcome
Wayland GDK backend should behave like X11, probably.
Version information
I've tested this on an up-to-date Fedora 34 machine (with GTK 3.24.30).