backend/x11: set a blank cursor rather than hiding globally

This actually simplifies the logic since we no longer have to wait for
enter/leave events, and also improves the UX when e.g. handling a crash
with gdb attached.

See #2659
This commit is contained in:
Ilia Mirkin 2021-01-17 18:05:38 -05:00 committed by Simon Ser
parent 04d89a8bc5
commit 966e653935
4 changed files with 21 additions and 34 deletions

View file

@ -212,36 +212,6 @@ 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;
}
case XCB_INPUT_TOUCH_BEGIN: {
xcb_input_touch_begin_event_t *ev = (xcb_input_touch_begin_event_t *)event;