diff options
-rw-r--r-- | sway/desktop/output.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 4b6e9122..1b9b5e67 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -578,6 +578,11 @@ static int output_repaint_timer_handler(void *data) { | |||
578 | } | 578 | } |
579 | } | 579 | } |
580 | 580 | ||
581 | if (!output->wlr_output->needs_frame && | ||
582 | !pixman_region32_not_empty(&output->damage_ring.current)) { | ||
583 | return 0; | ||
584 | } | ||
585 | |||
581 | int buffer_age; | 586 | int buffer_age; |
582 | if (!wlr_output_attach_render(output->wlr_output, &buffer_age)) { | 587 | if (!wlr_output_attach_render(output->wlr_output, &buffer_age)) { |
583 | return 0; | 588 | return 0; |
@@ -586,12 +591,6 @@ static int output_repaint_timer_handler(void *data) { | |||
586 | pixman_region32_t damage; | 591 | pixman_region32_t damage; |
587 | pixman_region32_init(&damage); | 592 | pixman_region32_init(&damage); |
588 | wlr_damage_ring_get_buffer_damage(&output->damage_ring, buffer_age, &damage); | 593 | wlr_damage_ring_get_buffer_damage(&output->damage_ring, buffer_age, &damage); |
589 | if (!output->wlr_output->needs_frame && | ||
590 | !pixman_region32_not_empty(&output->damage_ring.current)) { | ||
591 | pixman_region32_fini(&damage); | ||
592 | wlr_output_rollback(output->wlr_output); | ||
593 | return 0; | ||
594 | } | ||
595 | 594 | ||
596 | struct timespec now; | 595 | struct timespec now; |
597 | clock_gettime(CLOCK_MONOTONIC, &now); | 596 | clock_gettime(CLOCK_MONOTONIC, &now); |