From 6a9995d18cfa5be560cd49b56ba6b751d19f3425 Mon Sep 17 00:00:00 2001 From: ixru Date: Sun, 7 Oct 2018 21:26:38 +0200 Subject: [PATCH 1/2] Fix cursor visibility on surface commit --- types/wlr_output.c | 1 + 1 file changed, 1 insertion(+) diff --git a/types/wlr_output.c b/types/wlr_output.c index 35a3ab14..5f07d51a 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -874,6 +874,7 @@ static void output_cursor_handle_commit(struct wl_listener *listener, struct wlr_output_cursor *cursor = wl_container_of(listener, cursor, surface_commit); output_cursor_commit(cursor, true); + output_cursor_update_visible(cursor); } static void output_cursor_handle_destroy(struct wl_listener *listener, From 8d0997a5e70d3c110add04bca70657204490bd23 Mon Sep 17 00:00:00 2001 From: ixru Date: Mon, 8 Oct 2018 15:58:24 +0200 Subject: [PATCH 2/2] Better placement of visibility check --- types/wlr_output.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/wlr_output.c b/types/wlr_output.c index 5f07d51a..874678d0 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -853,6 +853,7 @@ static void output_cursor_commit(struct wlr_output_cursor *cursor, cursor->enabled = wlr_surface_has_buffer(surface); cursor->width = surface->current.width * cursor->output->scale; cursor->height = surface->current.height * cursor->output->scale; + output_cursor_update_visible(cursor); if (update_hotspot) { cursor->hotspot_x -= surface->current.dx * cursor->output->scale; cursor->hotspot_y -= surface->current.dy * cursor->output->scale; @@ -874,7 +875,6 @@ static void output_cursor_handle_commit(struct wl_listener *listener, struct wlr_output_cursor *cursor = wl_container_of(listener, cursor, surface_commit); output_cursor_commit(cursor, true); - output_cursor_update_visible(cursor); } static void output_cursor_handle_destroy(struct wl_listener *listener, @@ -916,10 +916,9 @@ void wlr_output_cursor_set_surface(struct wlr_output_cursor *cursor, if (surface != NULL) { wl_signal_add(&surface->events.commit, &cursor->surface_commit); wl_signal_add(&surface->events.destroy, &cursor->surface_destroy); - output_cursor_commit(cursor, false); cursor->visible = false; - output_cursor_update_visible(cursor); + output_cursor_commit(cursor, false); } else { cursor->enabled = false; cursor->width = 0;