6 Commits

Author SHA1 Message Date
Andrea Chiavazza 41be906af3 revert to using the static array 2025-03-28 16:37:41 +00:00
Andrea Chiavazza 8d34d53ea5 WIP fix keybindings wrongly causing key repeats on key release 2025-03-28 12:41:38 +00:00
Andrea Chiavazza e23fec173a WIP remove the static array and rework the fix 2025-03-26 12:38:59 +00:00
Andrea Chiavazza 6cff4367ae remove print to stderr 2025-03-26 10:13:22 +00:00
Andrea Chiavazza 82e3bd95fc make the logic more rigorous 2025-03-25 11:04:33 +00:00
Andrea Chiavazza 609d89642c don't pass released-key events of handled events to the clients 2025-03-24 20:23:50 +00:00
+9 -1
View File
@@ -1591,6 +1591,7 @@ keypress(struct wl_listener *listener, void *data)
int handled = 0;
uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard);
static bool consumed[KEY_MAX + 1];
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
@@ -1612,9 +1613,16 @@ keypress(struct wl_listener *listener, void *data)
wl_event_source_timer_update(group->key_repeat_source, 0);
}
if (handled)
if (handled) {
consumed[event->keycode] = true;
return;
}
if (consumed[event->keycode]) {
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED)
consumed[event->keycode] = false;
return; // don't pass to the client the release event of a handled key-press
}
wlr_seat_set_keyboard(seat, &group->wlr_group->keyboard);
/* Pass unhandled keycodes along to the client. */
wlr_seat_keyboard_notify_key(seat, event->time_msec,