From 8c5a110d4ca85f367a108e18968326ed4ff65ae6 Mon Sep 17 00:00:00 2001 From: emersion Date: Wed, 18 Oct 2017 19:14:16 +0200 Subject: [PATCH 1/2] Fix hidden cursor on wayland backend --- backend/wayland/output.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/wayland/output.c b/backend/wayland/output.c index d308b907..e1138ee1 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -66,10 +66,12 @@ static bool wlr_wl_output_set_cursor(struct wlr_output *_output, } if (!buf) { // Hide cursor - wl_surface_destroy(output->cursor_surface); - munmap(output->cursor_data, output->cursor_buf_size); - output->cursor_surface = NULL; - output->cursor_buf_size = 0; + if (output->cursor_surface) { + 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; From a7d7659a930bb73ec34b00c492074fbf812377b2 Mon Sep 17 00:00:00 2001 From: emersion Date: Wed, 18 Oct 2017 20:13:59 +0200 Subject: [PATCH 2/2] Fix render errors with gnome-terminal --- types/wlr_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/wlr_output.c b/types/wlr_output.c index 4c9814ef..eb969b9a 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -361,7 +361,9 @@ void wlr_output_swap_buffers(struct wlr_output *output) { renderer = output->cursor.surface->renderer; } - if (texture && renderer) { + // We check texture->valid because some clients set a cursor surface + // with a NULL buffer to hide it + if (renderer && texture && texture->valid) { float matrix[16]; wlr_texture_get_matrix(texture, &matrix, &output->transform_matrix, output->cursor.x, output->cursor.y);