Repository navigation
fix: accept keycode-only modifiers in parse_mod - #1388
Merged
DreamMaoMao merged 1 commit intoSep 11, 2026
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The keys docs show binds that use keycodes as the modifier, like
bind=code:64,code:24,killclientandbind=code:64+code:133,code:24,killclient, but neither of them loads. The config check printsUnknown modifier: code:64and the bind is dropped.In
parse_mod(), thecode:branch ORs the right modifier bit intomodbut never setsmatch_success, so when every token is a keycode the function falls through to the!match_successpath and returnsUINT32_MAX. A mixed form likeSUPER+code:50only works because the named modifier sets the flag. This started with bcee63f (the config check added in 0.12.0), and sinceparse_mod()is shared it also affects mousebind, axisbind, gesturebind and the global keybinding window rule.The fix sets
match_successin the four recognised keycode cases, the same way the named-modifier branch does. An unknown keycode such ascode:24still ends up as an unknown modifier.I checked it by compiling
trim_whitespace()andparse_mod()straight out ofparse_config.cinto a small harness with stubbed wlroots constants. Before the changecode:64andcode:64+code:133return 4294967295, after it they return ALT and ALT|LOGO.ALT,SUPER+SHIFT,NONE,SUPER+code:50,code:24andbogusgive the same result either way. I did not build the full compositor, and the file passes clang-format unchanged.AI tools used