From d1eab10266eabbcb33eeb9178491234d059dbe99 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Sat, 30 Nov 2019 16:29:39 +0100 Subject: output: Schedule idle frames if we do not render Repaint scheduling delays output render and frame done events from output frame events, and block idle frame events from being scheduled in between output frame done and output render in this period of time. If a surface is committed after its frame done event, but before output render, idle frame requests will be blocked, and the surface relies on the upcoming render to schedule a frame. If when the repaint timer expires, output render is deemed unnecessary, no frame will be scheduled. This can lead to surfaces never having their frame callbacks fire. To fix this, we store that a surface has requested a frame in surface_needs_frame. When the repaint expires, if no render is deemed necessary, we check this flag and schedule an idle frame. Fixes #4768 --- include/sway/output.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sway/output.h b/include/sway/output.h index bc03f4c5..b1c74258 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -57,6 +57,7 @@ struct sway_output { uint32_t refresh_nsec; int max_render_time; // In milliseconds struct wl_event_source *repaint_timer; + bool surface_needs_frame; }; struct sway_output *output_create(struct wlr_output *wlr_output); -- cgit v1.2.3-54-g00ecf