diff options
author | emersion <contact@emersion.fr> | 2017-10-12 13:25:29 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-10-12 13:25:29 +0200 |
commit | 19860c03f7567bd85ffd735ce2ccc90c454dd5b1 (patch) | |
tree | 4f3979d927fa590ced4f84f97e87d2958d0fc542 /backend | |
parent | 92daa790bb4ac1b15eedd91e02ab65b340e8f2a5 (diff) |
Better handling of hidden cursors in wayland backend, add TODOs
Diffstat (limited to 'backend')
-rw-r--r-- | backend/wayland/output.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 2616b347..d308b907 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -66,8 +66,12 @@ static bool wlr_wl_output_set_cursor(struct wlr_output *_output, } if (!buf) { // Hide cursor - wl_pointer_set_cursor(output->backend->pointer, output->enter_serial, - NULL, 0, 0); + wl_surface_destroy(output->cursor_surface); + munmap(output->cursor_data, output->cursor_buf_size); + output->cursor_surface = NULL; + output->cursor_buf_size = 0; + wlr_wl_output_update_cursor(output, output->enter_serial, hotspot_x, + hotspot_y); return true; } @@ -160,7 +164,7 @@ static void wlr_wl_output_destroy(struct wlr_output *_output) { void wlr_wl_output_update_cursor(struct wlr_wl_backend_output *output, uint32_t serial, int32_t hotspot_x, int32_t hotspot_y) { - if (output->cursor_surface && output->backend->pointer && serial) { + if (output->backend->pointer && serial) { wl_pointer_set_cursor(output->backend->pointer, serial, output->cursor_surface, hotspot_x, hotspot_y); } |