diff options
author | Simon Ser <contact@emersion.fr> | 2023-05-03 11:30:25 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-05-03 11:32:51 +0200 |
commit | bf8ae8a0367427a595e1fb804a27b7cb8605f8ae (patch) | |
tree | 37b6b98fd797c80a1bedc6d161bfd1ef55b38448 | |
parent | a93fc8afd60646243ee635b443fc2a17e2d97a18 (diff) |
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.
-rw-r--r-- | types/output/cursor.c | 4 |
1 files 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); |