diff options
author | Versus Void <versusvoid@gmail.com> | 2017-10-06 12:03:34 +0300 |
---|---|---|
committer | Versus Void <versusvoid@gmail.com> | 2017-10-06 22:02:29 +0000 |
commit | 568b270cdfcee0f1427417510ef868d54fd8c223 (patch) | |
tree | 1065bf6b52c22ed7854cd733dda388cff9888347 /backend | |
parent | b2d478a4189ffd96dc6158003f5cde76b70bd368 (diff) |
Use xkb_state_update_mask() with Wayland backend
Fix #158
Diffstat (limited to 'backend')
-rw-r--r-- | backend/libinput/keyboard.c | 3 | ||||
-rw-r--r-- | backend/wayland/wl_seat.c | 7 | ||||
-rw-r--r-- | backend/x11/backend.c | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c index 53c3a61b..00a7ecdf 100644 --- a/backend/libinput/keyboard.c +++ b/backend/libinput/keyboard.c @@ -67,5 +67,6 @@ void handle_keyboard_key(struct libinput_event *event, wlr_event.state = WLR_KEY_PRESSED; break; } - wlr_keyboard_update_state(wlr_dev->keyboard, &wlr_event); + wlr_event.update_state = true; + wlr_keyboard_notify_key(wlr_dev->keyboard, &wlr_event); } diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c index ba3feb8d..fcfcc1d0 100644 --- a/backend/wayland/wl_seat.c +++ b/backend/wayland/wl_seat.c @@ -149,13 +149,16 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard, wlr_event.state = state; wlr_event.time_sec = time / 1000; wlr_event.time_usec = time * 1000; - wlr_keyboard_update_state(dev->keyboard, &wlr_event); + wlr_keyboard_notify_key(dev->keyboard, &wlr_event); } static void keyboard_handle_modifiers(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { - + struct wlr_input_device *dev = data; + assert(dev && dev->keyboard); + wlr_keyboard_notify_modifiers(dev->keyboard, mods_depressed, mods_latched, + mods_locked, group); } static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard, diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 88c022d1..ed88064e 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -51,9 +51,11 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e .keycode = ev->detail - 8, .state = event->response_type == XCB_KEY_PRESS ? WLR_KEY_PRESSED : WLR_KEY_RELEASED, + .update_state = true, }; - wl_signal_emit(&x11->keyboard.events.key, &key); + // TODO use xcb-xkb for more precise modifiers state? + wlr_keyboard_notify_key(&x11->keyboard, &key); x11->time = ev->time; break; } |