mirror of https://github.com/mpv-player/mpv
wayland: fix missed int -> double conversion for cursor scaling
Client side cursors have always had some issues with fractional scaling.
However since we changed to using viewporter for cursor scaling, most
(or all?) of the problems can be fixed. Unfortunately, a scaling factor
was being truncated to int instead of kept as a double. This matched the
old behavior with buffer_scale, but it's better to use double so the
viewport is actually set to the correct size. Of course, none of this is
relevant if the compositor is using cursor shape.
Fixes f0a6578259
Fixes #14001
This commit is contained in:
parent
bcc72f97ef
commit
00f43e0916
|
@ -2070,7 +2070,7 @@ static int set_cursor_visibility(struct vo_wayland_seat *s, bool on)
|
|||
struct wl_buffer *buffer = wl_cursor_image_get_buffer(img);
|
||||
if (!buffer)
|
||||
return VO_FALSE;
|
||||
int scale = MPMAX(wl->scaling, 1);
|
||||
double scale = MPMAX(wl->scaling, 1);
|
||||
wl_pointer_set_cursor(s->pointer, s->pointer_enter_serial, wl->cursor_surface,
|
||||
img->hotspot_x / scale, img->hotspot_y / scale);
|
||||
wp_viewport_set_destination(wl->cursor_viewport, lround(img->width / scale),
|
||||
|
|
Loading…
Reference in New Issue