From f5ba8006c9ee9df454a4f5736dde4b756bd1072b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 5 Mar 2020 13:44:34 +0100 Subject: Only schedule a frame if client has requested a frame callback When a client hasn't damaged its surface, we only need to schedule an output frame if the client has requested a frame callback. --- sway/desktop/output.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sway/desktop') diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 16c6fc54..ab28f25c 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -681,8 +681,10 @@ static void damage_surface_iterator(struct sway_output *output, struct sway_view wlr_output_damage_add_box(output->damage, &box); } - output->surface_needs_frame = true; - wlr_output_schedule_frame(output->wlr_output); + if (!wl_list_empty(&surface->current.frame_callback_list)) { + output->surface_needs_frame = true; + wlr_output_schedule_frame(output->wlr_output); + } } void output_damage_surface(struct sway_output *output, double ox, double oy, -- cgit v1.2.3-54-g00ecf