From 36c0d5fe3a046fa77316a238f95686a9ca0c4557 Mon Sep 17 00:00:00 2001 From: JiDe Zhang Date: Mon, 6 May 2024 18:03:43 +0800 Subject: [PATCH] output: reset hardware_cursor on failure The DRM backend's set_cursor function always return true if the buffer is NULL. If using a NULL cursor's buffer on startup, the wlr_output_cursor will be marked as a hardware cursor. If the cursor later gains a non-NULL buffer and the DRM backend rejects that buffer, the cursor will remain marked as a hardware cursor, despite the backend not displaying it as such. As a result, the cursor will not be displayed at all. Fix this by always resetting the hardware_cursor field in output_cursor_attempt_hardware(). --- types/output/cursor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/output/cursor.c b/types/output/cursor.c index 7c3029c0..4d5a3706 100644 --- a/types/output/cursor.c +++ b/types/output/cursor.c @@ -280,6 +280,8 @@ static bool output_cursor_attempt_hardware(struct wlr_output_cursor *cursor) { return false; } + output->hardware_cursor = NULL; + struct wlr_texture *texture = cursor->texture; // If the cursor was hidden or was a software cursor, the hardware