From 76bddaccd63ee60245881dc188d3e15356f093f1 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 27 Jun 2021 09:55:33 -0500 Subject: 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. --- video/out/vo_wlshm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video/out/vo_wlshm.c') diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index e6ba0875f0..5e7ae94a1d 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -218,7 +218,7 @@ static void draw_image(struct vo *vo, struct mp_image *src) struct priv *p = vo->priv; struct vo_wayland_state *wl = vo->wl; struct buffer *buf; - bool render = wl->render || wl->opts->disable_vsync; + bool render = !wl->hidden || wl->opts->disable_vsync; wl->frame_wait = true; if (!render) -- cgit v1.2.3