Repository navigation
Fix the overlay swallowing all pointer input - #10
Merged
Merged
Conversation
Starting the overlay made the whole desktop unclickable — mouse and touchpad stopped working until it was stopped (seen on KDE/KWin Wayland, but the cause is backend-independent and affects X11 too). The empty input region was set on the GdkWindow from the "realize" handler, and GTK undid it immediately afterwards: gtk_widget_realize() emits "realize" and then calls gtk_widget_update_input_shape(), which finds no widget-level shape and resets the window's input region to NULL — accept all pointer events. The full-screen OVERLAY-layer window then captured every click. Set the region with Gtk.Widget.input_shape_combine_region() instead, so GTK itself re-applies it after realize, and re-assert it on "map": on Wayland GTK destroys the wl_surface on hide and builds a new one on show without re-sending the region (nothing marks it dirty), so toggling the overlay would otherwise start swallowing clicks again. Also drops the set_pass_through() call: it only affects event routing between GDK child windows, not a toplevel's compositor input region.
guilyx
approved these changes
Oct 25, 2026
guilyx
left a comment
Owner
There was a problem hiding this comment.
Thanks for the contribution, LGTM
Sorry for the delay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starting the overlay made the whole desktop unclickable — mouse and touchpad stopped responding until it was stopped. Reproduced on a KDE/KWin Wayland session with gtk-layer-shell, but the cause is backend-independent and applies to X11 too.
The empty input region was set on the
GdkWindowfrom therealizehandler, and GTK undid it immediately afterwards:gtk_widget_realize()emitsrealizeand then callsgtk_widget_update_input_shape(), which finds no widget-level shape and resets the window's input region to NULL — accept all pointer events. The full-screen OVERLAY-layer window then captured every click.This sets the region with
Gtk.Widget.input_shape_combine_region()instead, so GTK re-applies it after realize, and re-asserts it onmap: on Wayland GTK destroys thewl_surfaceon hide and builds a new one on show without re-sending the region (nothing marks it dirty), sotoggle/hide+showwould otherwise start swallowing clicks again.Also drops the
set_pass_through()call — it only affects event routing between GDK child windows, not a toplevel's compositor input region.Tested on KDE Wayland: clicks pass through to the windows underneath, and still do after hiding and re-showing the overlay.