mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
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:
parent
a93fc8afd6
commit
bf8ae8a036
1 changed files with 2 additions and 2 deletions
|
@ -303,8 +303,8 @@ static struct wlr_buffer *render_cursor_buffer(struct wlr_output_cursor *cursor)
|
||||||
struct wlr_renderer *renderer = output->renderer;
|
struct wlr_renderer *renderer = output->renderer;
|
||||||
assert(allocator != NULL && renderer != NULL);
|
assert(allocator != NULL && renderer != NULL);
|
||||||
|
|
||||||
int width = texture->width;
|
int width = texture->width * output->scale / scale;
|
||||||
int height = texture->height;
|
int height = texture->height * output->scale / scale;
|
||||||
if (output->impl->get_cursor_size) {
|
if (output->impl->get_cursor_size) {
|
||||||
// Apply hardware limitations on buffer size
|
// Apply hardware limitations on buffer size
|
||||||
output->impl->get_cursor_size(cursor->output, &width, &height);
|
output->impl->get_cursor_size(cursor->output, &width, &height);
|
||||||
|
|
Loading…
Reference in a new issue