aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
diff options
context:
space:
mode:
authorScott Anderson <ascent12@hotmail.com>2017-09-28 20:47:11 +1300
committerScott Anderson <ascent12@hotmail.com>2017-09-29 16:15:09 +1300
commit38bc0ab1ccefccc521e58e31762fc156bacaadcf (patch)
tree21621dcef037807f2e9470557d1b725674a7a973 /backend/x11
parent9ca5b0cae86aaed18db6882eadf04c402550d755 (diff)
Fix keycodes
Diffstat (limited to 'backend/x11')
-rw-r--r--backend/x11/backend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 23291bb7..1bf2b99c 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -45,7 +45,7 @@ int x11_event(int fd, uint32_t mask, void *data) {
struct wlr_event_keyboard_key key = {
.time_sec = ts.tv_sec,
.time_usec = ts.tv_nsec / 1000,
- .keycode = press->detail,
+ .keycode = press->detail - 8,
.state = WLR_KEY_PRESSED,
};
@@ -57,7 +57,7 @@ int x11_event(int fd, uint32_t mask, void *data) {
struct wlr_event_keyboard_key key = {
.time_sec = ts.tv_sec,
.time_usec = ts.tv_nsec / 1000,
- .keycode = press->detail,
+ .keycode = press->detail - 8,
.state = WLR_KEY_RELEASED,
};
@@ -94,6 +94,8 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
goto error_x11;
}
+ XSetEventQueueOwner(x11->xlib_conn, XCBOwnsEventQueue);
+
int fd = xcb_get_file_descriptor(x11->xcb_conn);
struct wl_event_loop *ev = wl_display_get_event_loop(display);
x11->event_source = wl_event_loop_add_fd(ev, fd, WL_EVENT_READABLE, x11_event, x11);