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.
This commit is contained in:
Simon Ser 2023-05-03 11:30:25 +02:00
parent a93fc8afd6
commit bf8ae8a036

View file

@ -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);