From 3c76b93272077bed3eb6caa90b738e22e033d068 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 6 Mar 2025 11:30:55 +0100 Subject: [PATCH] output/cursor: drop output_cursor_reset() This function is ill-named: it doesn't reset anything. It probably contained more logic in the past and got stripped down. --- types/output/cursor.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/types/output/cursor.c b/types/output/cursor.c index af1663574..137dab736 100644 --- a/types/output/cursor.c +++ b/types/output/cursor.c @@ -149,12 +149,6 @@ static void output_cursor_damage_whole(struct wlr_output_cursor *cursor) { pixman_region32_fini(&damage); } -static void output_cursor_reset(struct wlr_output_cursor *cursor) { - if (cursor->output->hardware_cursor != cursor) { - output_cursor_damage_whole(cursor); - } -} - static void output_cursor_update_visible(struct wlr_output_cursor *cursor) { struct wlr_box output_box; output_box.x = output_box.y = 0; @@ -382,7 +376,9 @@ bool output_cursor_set_texture(struct wlr_output_cursor *cursor, struct wlr_drm_syncobj_timeline *wait_timeline, uint64_t wait_point) { struct wlr_output *output = cursor->output; - output_cursor_reset(cursor); + if (cursor->output->hardware_cursor != cursor) { + output_cursor_damage_whole(cursor); + } cursor->enabled = texture != NULL; if (texture != NULL) { @@ -481,10 +477,11 @@ void wlr_output_cursor_destroy(struct wlr_output_cursor *cursor) { if (cursor == NULL) { return; } - output_cursor_reset(cursor); if (cursor->output->hardware_cursor == cursor) { // If this cursor was the hardware cursor, disable it output_disable_hardware_cursor(cursor->output); + } else { + output_cursor_damage_whole(cursor); } wl_list_remove(&cursor->renderer_destroy.link); if (cursor->own_texture) {