aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2024-07-15 00:12:39 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2024-07-17 08:44:16 +0200
commit19ca790a9f304bb138e531719a8a42f145f835f9 (patch)
tree9647440d40ed0b838be2e23aa731a3d785b5466a
parentci: use package x11-servers/xwayland instead of x11-servers/xwayland-devel (diff)
downloadsway-v1.10.tar.gz
sway-v1.10.tar.zst
sway-v1.10.zip
desktop/output: Stop repaint loop when not neededv1.10
1e0031781fc9 refactored repaint to accumulate all changes in a single wlr_output_state and commit them at the end of the repaint loop, replacing a call to wlr_scene_output_commit. wlr_scene_output_commit contains an early bail-out when no frame has been requested and no damage has accumulated, which was not replicated as part of this refactor, causing the repaint loop to never pause. Replicate the logic to stop the repaint loop as needed. Fixes: 1e0031781fc9 ("desktop/output: unify page-flip codepath") (cherry picked from commit 3f327b3db0c1fc6985c0ed3231e1bd6296584dad)
-rw-r--r--sway/desktop/output.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index f936b2a8..27ede68e 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -247,6 +247,13 @@ static int output_repaint_timer_handler(void *data) {
247 .color_transform = output->color_transform, 247 .color_transform = output->color_transform,
248 }; 248 };
249 249
250 struct wlr_output *wlr_output = output->wlr_output;
251 struct wlr_scene_output *scene_output = output->scene_output;
252 if (!wlr_output->needs_frame && !output->gamma_lut_changed &&
253 !pixman_region32_not_empty(&scene_output->pending_commit_damage)) {
254 return 0;
255 }
256
250 struct wlr_output_state pending; 257 struct wlr_output_state pending;
251 wlr_output_state_init(&pending); 258 wlr_output_state_init(&pending);
252 if (!wlr_scene_output_build_state(output->scene_output, &pending, &opts)) { 259 if (!wlr_scene_output_build_state(output->scene_output, &pending, &opts)) {