diff options
author | Simon Ser <contact@emersion.fr> | 2023-03-06 16:56:19 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-04-14 17:43:37 +0200 |
commit | 777df223777f318f9b0173d12f2162f29d7517da (patch) | |
tree | 4af2d7f456cb89ee70c457eac9d3d4754e1759be /sway/desktop | |
parent | 5e847fe3c8bbb27f45ec6f4f6a8dbbe617867550 (diff) |
Skip direct scan-out commit when damage is empty
When there is no damage, no need to perform an output commit, even
when direct scan-out is used.
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 59319f62..91a5936a 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -556,6 +556,11 @@ static int output_repaint_timer_handler(void *data) { wlr_output->frame_pending = false; + if (!wlr_output->needs_frame && + !pixman_region32_not_empty(&output->damage_ring.current)) { + return 0; + } + struct sway_workspace *workspace = output->current.active_workspace; if (workspace == NULL) { return 0; @@ -588,11 +593,6 @@ static int output_repaint_timer_handler(void *data) { } } - if (!output->wlr_output->needs_frame && - !pixman_region32_not_empty(&output->damage_ring.current)) { - return 0; - } - int buffer_age; if (!wlr_output_attach_render(output->wlr_output, &buffer_age)) { return 0; |