From a85eb14f1cf29917182c5de52ddf5d160e8b8c3c Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Wed, 25 Sep 2024 22:18:55 +0200 Subject: [PATCH] output/cursor: Lock software cursor on no hw support There is no need for us to repeatedly try hardware cursors if there is no support. Lock software cursors to skip future tests. --- types/output/cursor.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/output/cursor.c b/types/output/cursor.c index 7bc8d0d69..2a6354950 100644 --- a/types/output/cursor.c +++ b/types/output/cursor.c @@ -203,6 +203,14 @@ static struct wlr_buffer *render_cursor_buffer(struct wlr_output_cursor *cursor) const struct wlr_output_cursor_size *sizes = output->impl->get_cursor_sizes(cursor->output, &sizes_len); + if (sizes == NULL) { + // No cursor support + wlr_log(WLR_DEBUG, "Output '%s' has no cursor support, disabling permanently", + output->name); + output->software_cursor_locks++; + return NULL; + } + bool found = false; for (size_t i = 0; i < sizes_len; i++) { struct wlr_output_cursor_size size = sizes[i];