aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-03-28 21:41:55 +0200
committerDrew DeVault <sir@cmpwn.com>2019-04-11 09:19:57 -0600
commita800aa3fb44ecabcebfc5a1bf1d07ee201a688ed (patch)
treeab5ee0cecd1ebee96f06699d22270359e3a7b80f
parent524f5c84252d3a39422de08a8098ecb203bb5cb7 (diff)
rootston: disable then enable outputs when applying output-management state
-rw-r--r--rootston/output.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/rootston/output.c b/rootston/output.c
index 15737733..54d27d0d 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -443,12 +443,21 @@ void handle_output_manager_apply(struct wl_listener *listener, void *data) {
bool ok = true;
struct wlr_output_configuration_head_v1 *config_head;
+ // First disable outputs we need to disable
+ wl_list_for_each(config_head, &config->heads, link) {
+ struct wlr_output *wlr_output = config_head->state.output;
+ if (!config_head->state.enabled) {
+ ok &= wlr_output_enable(wlr_output, false);
+ }
+ }
+
+ // Then enable outputs that need to
wl_list_for_each(config_head, &config->heads, link) {
struct wlr_output *wlr_output = config_head->state.output;
- ok &= wlr_output_enable(wlr_output, config_head->state.enabled);
if (!config_head->state.enabled) {
continue;
}
+ ok &= wlr_output_enable(wlr_output, true);
if (config_head->state.mode != NULL) {
ok &= wlr_output_set_mode(wlr_output, config_head->state.mode);
} else {