diff options
author | Dudemanguy <random342@airmail.cc> | 2024-04-14 00:14:04 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-04-14 17:09:31 +0000 |
commit | cb6e7c7a55923c3ba62fff2c36a224169443c33a (patch) | |
tree | e71b482a1b01019bb0f6c6865ba98a04001e78fd /video/out | |
parent | 895f40e150d4bf2261a96fc2586d75f998d2ac5d (diff) | |
download | mpv-cb6e7c7a55923c3ba62fff2c36a224169443c33a.tar.bz2 mpv-cb6e7c7a55923c3ba62fff2c36a224169443c33a.tar.xz |
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.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/wayland_common.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 8211facf90..ab96ede166 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -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); |