summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2021-06-27 09:55:33 -0500
committerDudemanguy <random342@airmail.cc>2021-06-27 10:58:42 -0500
commit76bddaccd63ee60245881dc188d3e15356f093f1 (patch)
tree5801a80873305087490ff439aab8b0778f42b2f5 /video/out/wayland_common.c
parent573f696077026f6d008574234399518a0e810ee7 (diff)
downloadmpv-76bddaccd63ee60245881dc188d3e15356f093f1.tar.bz2
mpv-76bddaccd63ee60245881dc188d3e15356f093f1.tar.xz
wayland: always be sure to initially try to render
A subtle regression from c26d833. On sway if mpv was set to be a floating window in the config, set_buffer_scale would actually get applied twice according to the wayland log. That meant a 1920x1080 window would appear as a 960x540 window if the scale of the wl_output was set to 2. This only affected egl on sway (didn't occur on weston and was too lazy to try anything else; probably they were fine). Since wl->render is initially false, that meant that the very first run through the render loop returns false. This probably caused something weird to happen with the set_buffer_scale calls (the egl window gets created and everything but mpv doesn't write to it just yet) which makes the set_buffer_scale call happen an extra time. Since it was always intended for mpv to initally render, this is worth fixing. Just chnage wl->render to wl->hidden (again) and flip the bools around. That way, the initial false value results in render == true and mpv tries to draw on the first pass. This fixes the weird scaling behavior because reasons.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 1cc41e648f..3e0ed8bbec 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -1964,18 +1964,17 @@ void vo_wayland_wait_frame(struct vo_wayland_state *wl)
if (wl->frame_wait) {
// Only consider consecutive missed callbacks.
if (wl->timeout_count > 1) {
- wl->render = false;
+ wl->hidden = true;
return;
} else {
wl->timeout_count += 1;
- wl->render = true;
+ wl->hidden = false;
return;
}
}
wl->timeout_count = 0;
- wl->render = true;
- return;
+ wl->hidden = false;
}
void vo_wayland_wait_events(struct vo *vo, int64_t until_time_us)