Merge branch 'notify-modifiers' into 'master'

seat/keyboard: add wlr_seat_client_notify_modifiers

See merge request wlroots/wlroots!4523
This commit is contained in:
danieldg 2026-04-10 14:30:38 +00:00
commit 0efcc1c683
2 changed files with 65 additions and 12 deletions

View file

@ -55,6 +55,13 @@ struct wlr_seat_client {
struct wlr_serial_ringset serials;
bool needs_touch_frame;
// The client's current knowledge of the keyboard modifier state. This
// will lag behind the actual state if the client does not have
// keyboard focus; it is used by wlr_seat_client_notify_modifiers to
// allow actions like ctrl+scroll to work without sending duplicate
// events if modifiers are unchanged.
struct wlr_keyboard_modifiers tracked_modifiers;
// When the client doesn't support high-resolution scroll, accumulate deltas
// until we can notify a discrete event.
// Some mice have a free spinning wheel, making possible to lock the wheel
@ -528,6 +535,14 @@ void wlr_seat_keyboard_send_key(struct wlr_seat *seat, uint32_t time_msec,
void wlr_seat_keyboard_send_modifiers(struct wlr_seat *seat,
const struct wlr_keyboard_modifiers *modifiers);
/**
* Update an additional client's view of the keyboard modifier state. This
* does nothing if the target has keyboard focus or if its view of the modifier
* state still matches the current modifier state.
*/
void wlr_seat_client_notify_modifiers(struct wlr_seat *seat,
struct wlr_seat_client *target);
/**
* Send a keyboard enter event to the given surface and consider it to be the
* focused surface for the keyboard. This will send a leave event to the last