summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dwl.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/dwl.c b/dwl.c
index 69da91d..0ef6bfe 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1724,14 +1724,17 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test)
wl_list_for_each(config_head, &config->heads, link) {
struct wlr_output *wlr_output = config_head->state.output;
Monitor *m = wlr_output->data;
+ struct wlr_output_state state;
- wlr_output_enable(wlr_output, config_head->state.enabled);
+ wlr_output_state_init(&state);
+ wlr_output_state_set_enabled(&state, config_head->state.enabled);
if (!config_head->state.enabled)
goto apply_or_test;
+
if (config_head->state.mode)
- wlr_output_set_mode(wlr_output, config_head->state.mode);
+ wlr_output_state_set_mode(&state, config_head->state.mode);
else
- wlr_output_set_custom_mode(wlr_output,
+ wlr_output_state_set_custom_mode(&state,
config_head->state.custom_mode.width,
config_head->state.custom_mode.height,
config_head->state.custom_mode.refresh);
@@ -1741,18 +1744,16 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test)
if (m->m.x != config_head->state.x || m->m.y != config_head->state.y)
wlr_output_layout_add(output_layout, wlr_output,
config_head->state.x, config_head->state.y);
- wlr_output_set_transform(wlr_output, config_head->state.transform);
- wlr_output_set_scale(wlr_output, config_head->state.scale);
- wlr_output_enable_adaptive_sync(wlr_output,
+ wlr_output_state_set_transform(&state, config_head->state.transform);
+ wlr_output_state_set_scale(&state, config_head->state.scale);
+ wlr_output_state_set_adaptive_sync_enabled(&state,
config_head->state.adaptive_sync_enabled);
apply_or_test:
- if (test) {
- ok &= wlr_output_test(wlr_output);
- wlr_output_rollback(wlr_output);
- } else {
- ok &= wlr_output_commit(wlr_output);
- }
+ ok &= test ? wlr_output_test_state(wlr_output, &state)
+ : wlr_output_commit_state(wlr_output, &state);
+
+ wlr_output_state_finish(&state);
}
if (ok)