aboutsummaryrefslogtreecommitdiff
path: root/backend/x11/input_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/x11/input_device.c')
-rw-r--r--backend/x11/input_device.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/backend/x11/input_device.c b/backend/x11/input_device.c
index 08d982e6..a50f478a 100644
--- a/backend/x11/input_device.c
+++ b/backend/x11/input_device.c
@@ -9,6 +9,7 @@
#endif
#include <xcb/xcb.h>
+#include <xcb/xfixes.h>
#include <xcb/xinput.h>
#include <wlr/interfaces/wlr_input_device.h>
@@ -164,6 +165,36 @@ void handle_x11_xinput_event(struct wlr_x11_backend *x11,
x11->time = ev->time;
break;
}
+ case XCB_INPUT_ENTER: {
+ xcb_input_enter_event_t *ev = (xcb_input_enter_event_t *)event;
+
+ output = get_x11_output_from_window_id(x11, ev->event);
+ if (!output) {
+ return;
+ }
+
+ if (!output->cursor_hidden) {
+ xcb_xfixes_hide_cursor(x11->xcb, output->win);
+ xcb_flush(x11->xcb);
+ output->cursor_hidden = true;
+ }
+ break;
+ }
+ case XCB_INPUT_LEAVE: {
+ xcb_input_leave_event_t *ev = (xcb_input_leave_event_t *)event;
+
+ output = get_x11_output_from_window_id(x11, ev->event);
+ if (!output) {
+ return;
+ }
+
+ if (output->cursor_hidden) {
+ xcb_xfixes_show_cursor(x11->xcb, output->win);
+ xcb_flush(x11->xcb);
+ output->cursor_hidden = false;
+ }
+ break;
+ }
}
}