From 8f7962ed44a1f2b9cc9792cfa506ed76ec31dcc0 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 9 Oct 2017 15:45:46 +0200 Subject: [PATCH] Do not commit surface on set_cursor, breaks GTK+ apps --- types/wlr_output.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/types/wlr_output.c b/types/wlr_output.c index 011451be8..cc4022eb0 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -171,8 +171,12 @@ bool wlr_output_set_cursor(struct wlr_output *output, return set_cursor(output, buf, stride, width, height, hotspot_x, hotspot_y); } -static void commit_cursor_surface(struct wlr_output *output, - struct wlr_surface *surface) { +static void handle_cursor_surface_commit(struct wl_listener *listener, + void *data) { + struct wlr_output *output = wl_container_of(listener, output, + cursor.surface_commit); + struct wlr_surface *surface = data; + struct wl_shm_buffer *buffer = wl_shm_buffer_get(surface->current->buffer); if (buffer == NULL) { return; @@ -194,15 +198,6 @@ static void commit_cursor_surface(struct wlr_output *output, wl_shm_buffer_end_access(buffer); } -static void handle_cursor_surface_commit(struct wl_listener *listener, - void *data) { - struct wlr_output *output = wl_container_of(listener, output, - cursor.surface_commit); - struct wlr_surface *surface = data; - - commit_cursor_surface(output, surface); -} - static void handle_cursor_surface_destroy(struct wl_listener *listener, void *data) { struct wlr_output *output = wl_container_of(listener, output, @@ -223,7 +218,6 @@ void wlr_output_set_cursor_surface(struct wlr_output *output, output->cursor.hotspot_y = hotspot_y; if (surface && output->cursor.surface == surface) { - commit_cursor_surface(output, surface); return; } @@ -238,7 +232,6 @@ void wlr_output_set_cursor_surface(struct wlr_output *output, if (surface != NULL) { wl_signal_add(&surface->events.commit, &output->cursor.surface_commit); wl_signal_add(&surface->events.destroy, &output->cursor.surface_destroy); - commit_cursor_surface(output, surface); } else { set_cursor(output, NULL, 0, 0, 0, hotspot_x, hotspot_y); }