Skip to content

GTK3: Disable low level keyboard hook unless CSD is explicitly requested#1687

Merged
danyeaw merged 2 commits intowingtk:mainfrom
ouwou:disable-ll-hook
Dec 16, 2025
Merged

GTK3: Disable low level keyboard hook unless CSD is explicitly requested#1687
danyeaw merged 2 commits intowingtk:mainfrom
ouwou:disable-ll-hook

Conversation

@ouwou
Copy link
Contributor

@ouwou ouwou commented Dec 11, 2025

GTK installs a low level keyboard hook for its shoddy aerosnap emulation but as a side effect it makes debugging extremely painful since if the main thread blocks, the low level handler never runs causing massive latency on keystrokes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2015
this patch disables it unless CSD is explicitly requested with GTK_CSD=1 since without CSD the hook serves no purpose
msys2 also applies this patch: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gtk3/0004-Disable-low-level-keyboard-hook.patch

Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ouwou, thanks so much for the contribution! I recommend we add a link to the upstream issue so we can keep track of what the patch was for. Do you know if someone tried to open a MR to GTK with this change?

Co-authored-by: Dan Yeaw <dan@yeaw.me>
@ouwou
Copy link
Contributor Author

ouwou commented Dec 13, 2025

there isnt an MR with this specifically, since iirc GTK_CSD being unset still enables CSD as a default but without the hook which technically kills some functionality. as far as i can tell there is:
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4252 which removes the hook but looks to be targeting only gtk4
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3331 targets gtk3 and would remove the hook but this looks dead

@danyeaw danyeaw merged commit 45c8378 into wingtk:main Dec 16, 2025
18 of 23 checks passed
@danyeaw
Copy link
Member

danyeaw commented Dec 16, 2025

Thanks @ouwou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants