diff options
author | emersion <contact@emersion.fr> | 2018-03-31 12:07:58 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-31 12:10:43 -0400 |
commit | 7b88ace557f6aae4b7aa41b72263c628e637a892 (patch) | |
tree | 3255d980b1bff37565b478f2870d2e1dc161c94d | |
parent | 96c6091f802c803ccd6c7acd3e1165f6a8d4da2d (diff) |
backend/x11: hide cursor
-rw-r--r-- | backend/x11/backend.c | 12 | ||||
-rw-r--r-- | backend/x11/output.c | 4 | ||||
-rw-r--r-- | include/backend/x11.h | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 90658f26..225fc49d 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -171,6 +171,15 @@ static bool wlr_x11_backend_start(struct wlr_backend *backend) { } } + // create a blank cursor + xcb_pixmap_t pix = xcb_generate_id(x11->xcb_conn); + xcb_create_pixmap(x11->xcb_conn, 1, pix, x11->screen->root, 1, 1); + + x11->cursor = xcb_generate_id(x11->xcb_conn); + xcb_create_cursor(x11->xcb_conn, x11->cursor, pix, pix, 0, 0, 0, 0, 0, 0, + 0, 0); + xcb_free_pixmap(x11->xcb_conn, pix); + #ifdef WLR_HAS_XCB_XKB const xcb_query_extension_reply_t *reply = xcb_get_extension_data(x11->xcb_conn, &xcb_xkb_id); @@ -239,6 +248,9 @@ static void wlr_x11_backend_destroy(struct wlr_backend *backend) { wlr_egl_finish(&x11->egl); + if (x11->cursor) { + xcb_free_cursor(x11->xcb_conn, x11->cursor); + } if (x11->xlib_conn) { XCloseDisplay(x11->xlib_conn); } diff --git a/backend/x11/output.c b/backend/x11/output.c index 9e7424d8..2220bc2e 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -135,6 +135,10 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) { strlen(title), title); } + uint32_t cursor_values[] = { x11->cursor }; + xcb_change_window_attributes(x11->xcb_conn, output->win, XCB_CW_CURSOR, + cursor_values); + xcb_map_window(x11->xcb_conn, output->win); xcb_flush(x11->xcb_conn); diff --git a/include/backend/x11.h b/include/backend/x11.h index 0426e481..33c9a427 100644 --- a/include/backend/x11.h +++ b/include/backend/x11.h @@ -58,6 +58,9 @@ struct wlr_x11_backend { // The time we last received an event xcb_timestamp_t time; + // A blank cursor + xcb_cursor_t cursor; + #ifdef WLR_HAS_XCB_XKB bool xkb_supported; uint8_t xkb_base_event; |