Skip to content

Commit

Permalink
input: Propagate modifiers to clients with only pointer focus
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
danieldg committed Jan 26, 2024
1 parent e39b0b8 commit 1c12934
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sway/input/seatop_default.c
Expand Up @@ -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,
Expand Down

0 comments on commit 1c12934

Please sign in to comment.