Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit ab53f5e

Browse files
committed
Make wlr_output_enable idempotent
Enabling or disabling an output should be idempotent. Previously, this was not the case, causing bugs.
1 parent fb393dd commit ab53f5e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

types/output/output.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,12 @@ static void output_update_matrix(struct wlr_output *output) {
175175
}
176176

177177
void wlr_output_enable(struct wlr_output *output, bool enable) {
178+
output->pending.enabled = enable;
178179
if (output->enabled == enable) {
179180
output->pending.committed &= ~WLR_OUTPUT_STATE_ENABLED;
180-
return;
181+
} else {
182+
output->pending.committed |= WLR_OUTPUT_STATE_ENABLED;
181183
}
182-
183-
output->pending.committed |= WLR_OUTPUT_STATE_ENABLED;
184-
output->pending.enabled = enable;
185184
}
186185

187186
static void output_state_clear_mode(struct wlr_output_state *state) {

0 commit comments

Comments
 (0)