Wayland: Misc keyboard touchups#113256
Merged
akien-mga merged 3 commits intogodotengine:masterfrom Dec 16, 2025
Merged
Conversation
We always divided by the rate, which could be zero, which is a valid value (it means "disable key repeating").
The `wl_keyboard::repeat_info` event got introduced in version 4. On versions older than that, we defaulted to 0 delay, which means no repetition. That's a veeery old version and basically everything offers it, but it doesn't hurt to add a reasonable default.
Wasn't that much of a concern as it would have been disposed of next time a keyboard got added, but it's still a good thing to do.
Contributor
Author
|
Ok nevermind sorry for the flip-flop draft, I looked at my todo list and found another keyboard fix pending, but either I forgot what I meant or I was wrong xD Worst case I'll do it in another PR :P |
bruvzg
approved these changes
Dec 16, 2025
Member
|
Thanks! |
Member
|
Cherry-picked for 4.5.2. |
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.
This PR is a patchset, it should not be squashed.
It introduces a bunch of tiny fixes (few lines each) to the Wayland keyboard implementation that I didn't feel were worth as separate PRs.
Each commit is properly formatted with a message but here's the tl;dr and some extra info:
Wayland: Fix SIGFPE with repeat rate of 0
You can disable key repetition by setting the rate to 0, classic divide-by-zero.
Confimed before-and-after on sway with
sway input * repeat_rate 0.Wayland: Add default keyboard repetition values
It is technically possible to have a compositor so old that it doesn't support the
repeat_infoevent. Let's add some useful default values for key repetition (instead of 0), just in case.Confirmed that it works on Weston with this patch:
Also double-checked that the existing
wl_keyboard::repeat_infologic still works on sway, withsway input * repeat_rate 10.Destroy XKB keymap and state on seat capability change
I forgor 💀
Luckily it eventually cleaned up anyways, but y'know.
They should all hopefully be cherry-pickable to 4.5. The SIGFPE one is particularly important.
I'm also planning to do some other changes (
wl_keyboardversion 10, key handling logic consolidation), but I think that those are juicy enough for their own PR.