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.
This commit is contained in:
Julian Orth
2022-02-03 16:15:59 +00:00
committed by Dudemanguy
parent ddef9eb52d
commit c25129339d
+6
View File
@@ -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;
}