mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-05 07:16:12 -04:00
keyboard: fix modifiers event when no keymap set
Actually send the modifiers event when there is no keymap set. Compositors may need lower-level "raw" access to the key/modifiers events from the backend. Currently it is impossible for a compositor to get modifier events from the backend without them being filtered through an xkb_state controlled by wlroots. I need this feature for river in order to fix some keyboard state synchronization bugs. Note that setting a keymap resets the modifiers so I don't think setting wlr_keyboard->modifiers directly here is a concern.
This commit is contained in:
parent
c66a910753
commit
9de0ec3089
1 changed files with 10 additions and 0 deletions
|
|
@ -84,6 +84,16 @@ void wlr_keyboard_notify_modifiers(struct wlr_keyboard *keyboard,
|
||||||
uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked,
|
uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked,
|
||||||
uint32_t group) {
|
uint32_t group) {
|
||||||
if (keyboard->xkb_state == NULL) {
|
if (keyboard->xkb_state == NULL) {
|
||||||
|
if (keyboard->modifiers.depressed != mods_depressed ||
|
||||||
|
keyboard->modifiers.latched != mods_latched ||
|
||||||
|
keyboard->modifiers.locked != mods_locked ||
|
||||||
|
keyboard->modifiers.group != group) {
|
||||||
|
keyboard->modifiers.depressed = mods_depressed;
|
||||||
|
keyboard->modifiers.latched = mods_latched;
|
||||||
|
keyboard->modifiers.locked = mods_locked;
|
||||||
|
keyboard->modifiers.group = group;
|
||||||
|
wl_signal_emit_mutable(&keyboard->events.modifiers, keyboard);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
xkb_state_update_mask(keyboard->xkb_state, mods_depressed, mods_latched,
|
xkb_state_update_mask(keyboard->xkb_state, mods_depressed, mods_latched,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue