fix: keybinding release propagation (attempt 2) - #1209
Draft
Lubsch wants to merge 1 commit into
Draft
Conversation
Lubsch
marked this pull request as draft
July 23, 2026 06:18
Contributor
Author
|
I've just noticed that this now propagates release event for release keybinds when it shouldn't. I'Lll undraft this when I've properly tested it. |
Lubsch
force-pushed
the
keybinding-release-propagation
branch
from
July 24, 2026 00:40
2c4dfbb to
6e1c959
Compare
Also fixes the opposite case: Don't pass key press event when it's handled by an on-release keybinding. This makes the keybinding function always return true (meaning "handled") on both press and release for mappings even when it didn't actually execute the function because it's mapped to the opposite event type. This information is used by the keypress function to decide if it should propagate the event to the client. Fixes mangowm#348 This commit adds a 256 byte bool array `intercepted` to `KeyboardGroup` which stores whether a key was intercepted and shouldn't be passed to clients. Something similar is done by other compositors like sway: https://github.com/swaywm/sway/blob/6959a78a8f0d52f79ad7465135b3295307a5146a/include/sway/input/keyboard.h#L29 or river: https://codeberg.org/river/river-classic/src/commit/b1af960e1bea8506c25179775c18f902a5cb8c87/river/Keyboard.zig#L41
Lubsch
force-pushed
the
keybinding-release-propagation
branch
from
July 24, 2026 00:52
6e1c959 to
75a6b3f
Compare
DreamMaoMao
force-pushed
the
main
branch
3 times, most recently
from
August 10, 2026 05:15
0efe75b to
20ad711
Compare
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.
See also #1206 and #1206 (comment)
With the previous commit, there was a bug causing key repeats to not stop after releasing the button when a keybinding was pressed during key hold.
Steps to replicate:
You then must press j again to end the key repeat
This commit adds a 256 byte bool array
interceptedtoKeyboardGroupwhich stores whether a key's press was intercepted and shouldn't be passed to clients.I don't think this is the most elegant solution but something similar is done by other compositors
like sway: https://github.com/swaywm/sway/blob/6959a78a8f0d52f79ad7465135b3295307a5146a/include/sway/input/keyboard.h#L29
or river: https://codeberg.org/river/river-classic/src/commit/b1af960e1bea8506c25179775c18f902a5cb8c87/river/Keyboard.zig#L41