Skip to content

(fix) wayland: Handle KeyState::Repeated key events - #19

Merged
hecrj merged 1 commit into
iced-rs:2026-10-02from
mariinkys:wayland-key-repeated
Oct 4, 2026
Merged

hecrj merged 1 commit into
iced-rs:2026-10-02from
mariinkys:wayland-key-repeated

Conversation

@mariinkys

Copy link
Copy Markdown
  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

Hi, I've got an app that uses iced master that I regularly update, just updated again this week (last time was last weekend) and I've found an issue while running on Wayland after the update.

On Wayland, holding a key down crashes applications with:

thread 'main' panicked at src/platform_impl/linux/wayland/seat/keyboard/mod.rs:268:18:
internal error: entered unreachable code

The wl_keyboard handler only matches Key events whose state is Pressed or Released. Looking up a bit I found this: Compositors that do key repeat themselves (wl_seat version 10) send Key events with KeyState::Repeated while a key is held (more info), and those fall through to the _ => unreachable!() arm.

I've added an arm to handle that case based on the rest of code of the match arm. Holding a key no longer crashes and works as expected.

@hecrj
hecrj merged commit 4811646 into iced-rs:2026-10-02 Oct 4, 2026
6 of 39 checks passed
hecrj added a commit to iced-rs/iced that referenced this pull request Oct 4, 2026
Acisama pushed a commit to Acisama/iced that referenced this pull request Nov 1, 2026
JustSimplyKyle pushed a commit to JustSimplyKyle/iced that referenced this pull request Nov 9, 2026
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