From bf8ae8a0367427a595e1fb804a27b7cb8605f8ae Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 3 May 2023 11:30:25 +0200 Subject: [PATCH] output/cursor: fix buffer size when nested and scaled The Wayland, X11 and headless backends don't really care about the cursor size. We were picking a size identical to the texture size in that case. This is incorrect for LoDPI cursor textures on HiDPI outputs: in that case, we need to scale up the cursor texture. Fixes the cursor being chopped off under the Wayland backend with scale > 1. --- types/output/cursor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/output/cursor.c b/types/output/cursor.c index d83e3244..980ac69c 100644 --- a/types/output/cursor.c +++ b/types/output/cursor.c @@ -303,8 +303,8 @@ static struct wlr_buffer *render_cursor_buffer(struct wlr_output_cursor *cursor) struct wlr_renderer *renderer = output->renderer; assert(allocator != NULL && renderer != NULL); - int width = texture->width; - int height = texture->height; + int width = texture->width * output->scale / scale; + int height = texture->height * output->scale / scale; if (output->impl->get_cursor_size) { // Apply hardware limitations on buffer size output->impl->get_cursor_size(cursor->output, &width, &height);