diff options
-rw-r--r-- | sway/config/output.c | 32 | ||||
-rw-r--r-- | sway/tree/output.c | 6 |
2 files changed, 15 insertions, 23 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index aa53fc46..74d79130 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -178,12 +178,21 @@ void apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
178 | struct wlr_output *wlr_output = output->wlr_output; | 178 | struct wlr_output *wlr_output = output->wlr_output; |
179 | 179 | ||
180 | if (oc && oc->enabled == 0) { | 180 | if (oc && oc->enabled == 0) { |
181 | if (output->bg_pid != 0) { | 181 | if (output->enabled) { |
182 | terminate_swaybg(output->bg_pid); | 182 | if (output->bg_pid != 0) { |
183 | output->bg_pid = 0; | 183 | terminate_swaybg(output->bg_pid); |
184 | output->bg_pid = 0; | ||
185 | } | ||
186 | output_disable(output); | ||
187 | wlr_output_layout_remove(root->output_layout, wlr_output); | ||
188 | } | ||
189 | wlr_output_enable(wlr_output, false); | ||
190 | return; | ||
191 | } else if (!output->enabled) { | ||
192 | if (!oc || oc->dpms_state != DPMS_OFF) { | ||
193 | wlr_output_enable(wlr_output, true); | ||
184 | } | 194 | } |
185 | output_disable(output); | 195 | output_enable(output, oc); |
186 | wlr_output_layout_remove(root->output_layout, wlr_output); | ||
187 | return; | 196 | return; |
188 | } | 197 | } |
189 | 198 | ||
@@ -251,7 +260,7 @@ void apply_output_config(struct output_config *oc, struct sway_output *output) { | |||
251 | free(command); | 260 | free(command); |
252 | } | 261 | } |
253 | } | 262 | } |
254 | if (oc && oc->dpms_state != DPMS_IGNORE) { | 263 | if (oc) { |
255 | switch (oc->dpms_state) { | 264 | switch (oc->dpms_state) { |
256 | case DPMS_ON: | 265 | case DPMS_ON: |
257 | wlr_log(WLR_DEBUG, "Turning on screen"); | 266 | wlr_log(WLR_DEBUG, "Turning on screen"); |
@@ -292,17 +301,6 @@ void apply_output_config_to_outputs(struct output_config *oc) { | |||
292 | char *name = sway_output->wlr_output->name; | 301 | char *name = sway_output->wlr_output->name; |
293 | output_get_identifier(id, sizeof(id), sway_output); | 302 | output_get_identifier(id, sizeof(id), sway_output); |
294 | if (wildcard || !strcmp(name, oc->name) || !strcmp(id, oc->name)) { | 303 | if (wildcard || !strcmp(name, oc->name) || !strcmp(id, oc->name)) { |
295 | if (!sway_output->enabled) { | ||
296 | if (!oc->enabled) { | ||
297 | if (!wildcard) { | ||
298 | break; | ||
299 | } | ||
300 | continue; | ||
301 | } | ||
302 | |||
303 | output_enable(sway_output, oc); | ||
304 | } | ||
305 | |||
306 | struct output_config *current = oc; | 304 | struct output_config *current = oc; |
307 | if (wildcard) { | 305 | if (wildcard) { |
308 | struct output_config *tmp = get_output_config(name, id); | 306 | struct output_config *tmp = get_output_config(name, id); |
diff --git a/sway/tree/output.c b/sway/tree/output.c index 35589032..201e767f 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c | |||
@@ -54,12 +54,6 @@ struct sway_output *output_create(struct wlr_output *wlr_output) { | |||
54 | 54 | ||
55 | wl_list_insert(&root->all_outputs, &output->link); | 55 | wl_list_insert(&root->all_outputs, &output->link); |
56 | 56 | ||
57 | if (!wl_list_empty(&wlr_output->modes)) { | ||
58 | struct wlr_output_mode *mode = | ||
59 | wl_container_of(wlr_output->modes.prev, mode, link); | ||
60 | wlr_output_set_mode(wlr_output, mode); | ||
61 | } | ||
62 | |||
63 | output->workspaces = create_list(); | 57 | output->workspaces = create_list(); |
64 | output->current.workspaces = create_list(); | 58 | output->current.workspaces = create_list(); |
65 | 59 | ||