aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2020-03-05 13:44:34 +0100
committerLibravatar Drew DeVault <sir@cmpwn.com>2020-03-06 21:37:53 +0100
commitf5ba8006c9ee9df454a4f5736dde4b756bd1072b (patch)
treee7842f6c9a5c00a16565699ee6f0f6292234854d /sway/desktop/output.c
parentMake handle_destroy and output_repaint_timer_handler static (diff)
downloadsway-f5ba8006c9ee9df454a4f5736dde4b756bd1072b.tar.gz
sway-f5ba8006c9ee9df454a4f5736dde4b756bd1072b.tar.zst
sway-f5ba8006c9ee9df454a4f5736dde4b756bd1072b.zip
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.
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c6
1 files changed, 4 insertions, 2 deletions
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
681 wlr_output_damage_add_box(output->damage, &box); 681 wlr_output_damage_add_box(output->damage, &box);
682 } 682 }
683 683
684 output->surface_needs_frame = true; 684 if (!wl_list_empty(&surface->current.frame_callback_list)) {
685 wlr_output_schedule_frame(output->wlr_output); 685 output->surface_needs_frame = true;
686 wlr_output_schedule_frame(output->wlr_output);
687 }
686} 688}
687 689
688void output_damage_surface(struct sway_output *output, double ox, double oy, 690void output_damage_surface(struct sway_output *output, double ox, double oy,