diff options
author | Julian Orth <ju.orth@gmail.com> | 2022-02-02 22:36:05 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-02-03 16:15:59 +0000 |
commit | c25129339dc0ff57a21140b29357bdf181882fee (patch) | |
tree | 721093c528661f1350b2015b6da0b8d4ddd843f1 | |
parent | ddef9eb52d02dd6d5115c80a4adec99a8952bf96 (diff) | |
download | mpv-c25129339dc0ff57a21140b29357bdf181882fee.tar.bz2 mpv-c25129339dc0ff57a21140b29357bdf181882fee.tar.xz |
wayland: always start rendering after a resize
The wayland backend contains logic to detect if the window is hidden. If
so, we skip rendering as an optimization. However, if we receive
multiple resize events in rapid succession, we will send the compositor
new buffers faster than the refresh rate of the monitor. Therefore the
compositor will not send us frame events which we incorrectly interpret
as the window being hidden.
Once the last buffer has actually been rendered, the compositor sends us
a frame event. However, if at that point playback is paused, there is no
logic to restart rendering of frames that we skipped due to the above
optimization. Therefore we never send the compositor new buffers
corresponding to the new size of the window and the surface will either
be too small or too large.
The simplest solution is to always render a few frames after we receive
a resize event.
-rw-r--r-- | video/out/wayland_common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 285cccd132..5824804df0 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1559,6 +1559,12 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg) case VOCTRL_CHECK_EVENTS: { check_dnd_fd(wl); *events |= wl->pending_vo_events; + if (*events & VO_EVENT_RESIZE) { + *events |= VO_EVENT_EXPOSE; + wl->frame_wait = false; + wl->timeout_count = 0; + wl->hidden = false; + } wl->pending_vo_events = 0; return VO_TRUE; } |