mirror of https://github.com/mpv-player/mpv
wayland: check if scale actually changes in scaling events
The protocol strongly implies that this only happens when the value changes, and it's also what you would naturally expect. But maybe it's worth guarding this in cause for some reason the same value twice in a row happens.
This commit is contained in:
parent
895f40e150
commit
cb6e7c7a55
|
@ -996,7 +996,7 @@ static void surface_handle_preferred_buffer_scale(void *data,
|
|||
{
|
||||
struct vo_wayland_state *wl = data;
|
||||
|
||||
if (wl->fractional_scale_manager)
|
||||
if (wl->fractional_scale_manager || wl->scaling == scale)
|
||||
return;
|
||||
|
||||
wl->pending_scaling = scale;
|
||||
|
@ -1221,7 +1221,11 @@ static void preferred_scale(void *data,
|
|||
uint32_t scale)
|
||||
{
|
||||
struct vo_wayland_state *wl = data;
|
||||
wl->pending_scaling = (double)scale / 120;
|
||||
double new_scale = (double)scale / 120;
|
||||
if (wl->scaling == new_scale)
|
||||
return;
|
||||
|
||||
wl->pending_scaling = new_scale;
|
||||
wl->scale_configured = true;
|
||||
MP_VERBOSE(wl, "Obtained preferred scale, %f, from the compositor.\n",
|
||||
wl->pending_scaling);
|
||||
|
|
Loading…
Reference in New Issue