mirror of
https://github.com/swaywm/sway.git
synced 2024-11-24 08:51:27 +00:00
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.
This commit is contained in:
parent
e39b0b816b
commit
1c12934edd
|
@ -795,6 +795,8 @@ static void handle_pointer_axis(struct sway_seat *seat,
|
||||||
free(dev_id);
|
free(dev_id);
|
||||||
|
|
||||||
if (!handled) {
|
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,
|
wlr_seat_pointer_notify_axis(cursor->seat->wlr_seat, event->time_msec,
|
||||||
event->orientation, scroll_factor * event->delta,
|
event->orientation, scroll_factor * event->delta,
|
||||||
roundf(scroll_factor * event->delta_discrete), event->source,
|
roundf(scroll_factor * event->delta_discrete), event->source,
|
||||||
|
|
Loading…
Reference in a new issue