From 1c12934edd5e6cc90e80d2c19aa08bc43439dd8e Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Mon, 22 Jan 2024 21:15:28 -0500 Subject: [PATCH] input: Propagate modifiers to clients with only pointer focus When focus_follows_mouse is off, it is possible to hover and/or scroll windows without giving them keyboard focus. However, attempts to use Ctrl+scroll on such clients will not work correctly because the keyboard modifiers are not available. This patch propagates modifier state to the client with pointer focus before sending axis events. This depends on https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4523. https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/259 discusses permitting this behavior at the protocol level. --- sway/input/seatop_default.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index c56330fd..742b7a52 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c @@ -795,6 +795,8 @@ static void handle_pointer_axis(struct sway_seat *seat, free(dev_id); if (!handled) { + wlr_seat_client_notify_modifiers(cursor->seat->wlr_seat, + cursor->seat->wlr_seat->pointer_state.focused_client); wlr_seat_pointer_notify_axis(cursor->seat->wlr_seat, event->time_msec, event->orientation, scroll_factor * event->delta, roundf(scroll_factor * event->delta_discrete), event->source,