diff options
author | Simon Ser <contact@emersion.fr> | 2021-01-10 17:08:16 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-01-16 09:06:27 +0100 |
commit | b3e76d667855c16e97a4de1658d786492fed1571 (patch) | |
tree | 046fd6a54386dff2197087964655a8b05de77db7 | |
parent | 1fb9535e995fe97503252b79b255fb85f68d51ae (diff) | |
download | wlroots-b3e76d667855c16e97a4de1658d786492fed1571.tar.xz |
output: send commit event after pending state is cleared
References: https://github.com/swaywm/wlroots/issues/2098
-rw-r--r-- | types/wlr_output.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c index 4721f0b9..9790691a 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -612,13 +612,6 @@ bool wlr_output_commit(struct wlr_output *output) { output->commit_seq++; - struct wlr_output_event_commit event = { - .output = output, - .committed = output->pending.committed, - .when = &now, - }; - wlr_signal_emit_safe(&output->events.commit, &event); - bool scale_updated = output->pending.committed & WLR_OUTPUT_STATE_SCALE; if (scale_updated) { output->scale = output->pending.scale; @@ -649,7 +642,16 @@ bool wlr_output_commit(struct wlr_output *output) { output->needs_frame = false; } + uint32_t committed = output->pending.committed; output_state_clear(&output->pending); + + struct wlr_output_event_commit event = { + .output = output, + .committed = committed, + .when = &now, + }; + wlr_signal_emit_safe(&output->events.commit, &event); + return true; } |