diff --git a/docs/changelog.md b/docs/changelog.md index e2bc97b7e..c24672d8e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -17,6 +17,7 @@ brief notes about them may accumulate here. * Fixed an issue where the window would be redrawn on mouse move. This was most noticeable as a laggy mouse pointer when moving the mouse across a window running on the nouveau display driver on X11 and Wayland systems * Wayland: the raw key modifiers are now correctly propagated so that they activate when used with key assignments using the `key = "raw:123"` binding syntax. * Wayland: fixed window decoration and full screen handling [#224](https://github.com/wez/wezterm/issues/224) +* Wayland: fixed an issue where key repeat processing could "run away" and hang the application ### 20210203-095643-70a364eb diff --git a/window/src/os/wayland/keyboard.rs b/window/src/os/wayland/keyboard.rs index d10a5fedc..c9ef52148 100644 --- a/window/src/os/wayland/keyboard.rs +++ b/window/src/os/wayland/keyboard.rs @@ -70,7 +70,20 @@ impl KeyboardDispatcher { loop_handle, &seat, None, - RepeatKind::System, + // We use a Fixed rate here because if we use + // RepeatKind::System and/or a rate higher than the 25 + // repeats per second specified here, the repeat machinery + // in the toolkit generates synthetic results faster than + // can be kept up with. I think there might be a scheduling + // issue with the calloop crate. The issue manifests as + // the key generating LOTs more presses even after it has + // been released. + // Capping it to a reasonable (but subjectively not ideal) + // value avoids the application effectively hanging. + RepeatKind::Fixed { + rate: 25, + delay: 500, + }, move |evt: KbEvent, _, _| { inner.lock().unwrap().handle_event(evt); },