diff options
author | emersion <contact@emersion.fr> | 2018-01-21 22:16:55 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-01-21 22:18:06 +0100 |
commit | 59c53e8333cae17210832fb79514c4d0110c7de8 (patch) | |
tree | a2b06676b53f4f7ca075ce728155d0d442f69759 /include | |
parent | f704c3d42b80ad28bfd096e5467a5219c0778e3b (diff) | |
parent | e5fa4d8e8e6e81b0cdac9df2dcb1f589867c98f2 (diff) |
Merge remote-tracking branch 'upstream/master' into output-damage
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_keyboard.h | 14 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 27 |
2 files changed, 27 insertions, 14 deletions
diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index d32d6e96..c67cc4c2 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -32,6 +32,13 @@ enum wlr_keyboard_modifier { struct wlr_keyboard_impl; +struct wlr_keyboard_modifiers { + xkb_mod_mask_t depressed; + xkb_mod_mask_t latched; + xkb_mod_mask_t locked; + xkb_mod_mask_t group; +}; + struct wlr_keyboard { struct wlr_keyboard_impl *impl; // TODO: Should this store key repeat info too? @@ -45,12 +52,7 @@ struct wlr_keyboard { uint32_t keycodes[WLR_KEYBOARD_KEYS_CAP]; size_t num_keycodes; - struct { - xkb_mod_mask_t depressed; - xkb_mod_mask_t latched; - xkb_mod_mask_t locked; - xkb_mod_mask_t group; - } modifiers; + struct wlr_keyboard_modifiers modifiers; struct { int32_t rate; diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index 432e5dc3..c2a89f33 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -68,10 +68,12 @@ struct wlr_seat_keyboard_grab; struct wlr_keyboard_grab_interface { void (*enter)(struct wlr_seat_keyboard_grab *grab, - struct wlr_surface *surface); + struct wlr_surface *surface, uint32_t keycodes[], + size_t num_keycodes, struct wlr_keyboard_modifiers *modifiers); void (*key)(struct wlr_seat_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state); - void (*modifiers)(struct wlr_seat_keyboard_grab *grab); + void (*modifiers)(struct wlr_seat_keyboard_grab *grab, + struct wlr_keyboard_modifiers *modifiers); void (*cancel)(struct wlr_seat_keyboard_grab *grab); }; @@ -345,6 +347,11 @@ bool wlr_seat_pointer_has_grab(struct wlr_seat *seat); void wlr_seat_set_keyboard(struct wlr_seat *seat, struct wlr_input_device *dev); /** + * Get the active keyboard for the seat. + */ +struct wlr_keyboard *wlr_seat_get_keyboard(struct wlr_seat *seat); + +/** * Start a grab of the keyboard of this seat. The grabber is responsible for * handling all keyboard events until the grab ends. */ @@ -375,21 +382,24 @@ void wlr_seat_keyboard_notify_key(struct wlr_seat *seat, uint32_t time, * Send the modifier state to focused keyboard resources. Compositors should use * `wlr_seat_keyboard_notify_modifiers()` to respect any keyboard grabs. */ -void wlr_seat_keyboard_send_modifiers(struct wlr_seat *seat); +void wlr_seat_keyboard_send_modifiers(struct wlr_seat *seat, + struct wlr_keyboard_modifiers *modifiers); /** * Notify the seat that the modifiers for the keyboard have changed. Defers to * any keyboard grabs. */ -void wlr_seat_keyboard_notify_modifiers(struct wlr_seat *seat); +void wlr_seat_keyboard_notify_modifiers(struct wlr_seat *seat, + struct wlr_keyboard_modifiers *modifiers); /** * Notify the seat that the keyboard focus has changed and request it to be the * focused surface for this keyboard. Defers to any current grab of the seat's * keyboard. */ -void wlr_seat_keyboard_notify_enter(struct wlr_seat *wlr_seat, - struct wlr_surface *surface); +void wlr_seat_keyboard_notify_enter(struct wlr_seat *seat, + struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes, + struct wlr_keyboard_modifiers *modifiers); /** * Send a keyboard enter event to the given surface and consider it to be the @@ -398,8 +408,9 @@ void wlr_seat_keyboard_notify_enter(struct wlr_seat *wlr_seat, * `wlr_seat_keyboard_notify_enter()` to change keyboard focus to respect * keyboard grabs. */ -void wlr_seat_keyboard_enter(struct wlr_seat *wlr_seat, - struct wlr_surface *surface); +void wlr_seat_keyboard_enter(struct wlr_seat *seat, + struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes, + struct wlr_keyboard_modifiers *modifiers); /** * Clear the focused surface for the keyboard and leave all entered surfaces. |