backend, output: send commit events after applying all in wlr_backend_commit()

We were iterating over involved outputs, applying the new state and
sending the commit event for each one. This resulted in commit
events being fired while we weren't done applying the new state for
all outputs.

Fix this by first applying all of the states, then firing all of
the events.

Closes: https://github.com/swaywm/sway/issues/8829
This commit is contained in:
Simon Ser 2025-08-12 19:00:11 +02:00
parent 07e92fb868
commit 7392b3313a
3 changed files with 9 additions and 0 deletions

View file

@ -485,5 +485,10 @@ bool wlr_backend_commit(struct wlr_backend *backend,
output_apply_commit(state->output, &state->base);
}
for (size_t i = 0; i < states_len; i++) {
const struct wlr_backend_output_state *state = &states[i];
output_send_commit_event(state->output, &state->base);
}
return true;
}