From eee4aba5545a4911a11d7e8c6121354d79df5040 Mon Sep 17 00:00:00 2001 From: DeeJanuz <45082401+DeeJanuz@users.noreply.github.com> Date: Sun, 27 Sep 2026 09:10:28 -0600 Subject: [PATCH] Let key releases reach the desktop while the dashboard is open ft-screens dropped every key while the SteamVR dashboard was open or no screen had focus, releases included. A modifier held as the dashboard opened stayed down in the desktop, so later keys launched shortcuts (T opened Konsole as Ctrl+Alt+T). The release of a key the desktop got the press for now always goes through. Co-Authored-By: Claude Opus 5.5 --- screens/compositor.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/screens/compositor.c b/screens/compositor.c index b42ba5b..4c06999 100644 --- a/screens/compositor.c +++ b/screens/compositor.c @@ -303,13 +303,23 @@ static int child_exited(int sig, void *data) { return 0; } +static bool key_held(const struct wlr_keyboard *kb, uint32_t code) { + for (size_t i = 0; i < kb->num_keycodes; i++) + if (kb->keycodes[i] == code) return true; + return false; +} + // Keys from the input relay (physical keyboards): "key <1 press|0 release>". // They go to the screen KWin has keyboard focus on (the last one clicked), but not while -// the SteamVR dashboard is open: typing belongs to Steam then. +// the SteamVR dashboard is open: typing belongs to Steam then. The release of a key the +// desktop got the press for always goes through, or the key stays held there (a modifier +// held as the dashboard opens would otherwise modify every key typed after it). static void handle_key(struct server *s, uint32_t code, int value, char *reply, int size) { if (value == 2) return (void)snprintf(reply, size, "ok repeat ignored"); // KWin repeats itself - if (!s->seat->keyboard_state.focused_surface) return (void)snprintf(reply, size, "ok no focus"); - if (ft_vr_dashboard_visible()) return (void)snprintf(reply, size, "ok dashboard open"); + if (value || !key_held(&s->keyboard, code)) { + if (!s->seat->keyboard_state.focused_surface) return (void)snprintf(reply, size, "ok no focus"); + if (ft_vr_dashboard_visible()) return (void)snprintf(reply, size, "ok dashboard open"); + } struct wlr_keyboard_key_event ev = { .time_msec = now_ms(), .keycode = code, .update_state = true, .state = value ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED};