Merge remote-tracking branch 'upstream/master' into output-damage

This commit is contained in:
emersion 2018-01-21 22:16:55 +01:00
commit 59c53e8333
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
16 changed files with 220 additions and 92 deletions

View file

@ -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;

View file

@ -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);
};
@ -344,6 +346,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.