aboutsummaryrefslogtreecommitdiff
path: root/sway/config
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-09-05 14:55:13 -0400
committerGitHub <noreply@github.com>2018-09-05 14:55:13 -0400
commit49c937fc878da3ffb155429216ad8298202f1767 (patch)
tree281bd50400911abb33853a2c84c3335faea23eef /sway/config
parent610eb946171f782165a20614b2d3318b89273990 (diff)
parentc246cf84c8f5e99c0f2117f2d9d1772c08d7596c (diff)
Merge pull request #2572 from RedSoxFan/wlr-output-disabling
Call wlr_output_enable on enable/disable if needed
Diffstat (limited to 'sway/config')
-rw-r--r--sway/config/output.c32
1 files changed, 15 insertions, 17 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) {
struct wlr_output *wlr_output = output->wlr_output;
if (oc && oc->enabled == 0) {
- if (output->bg_pid != 0) {
- terminate_swaybg(output->bg_pid);
- output->bg_pid = 0;
+ if (output->enabled) {
+ if (output->bg_pid != 0) {
+ terminate_swaybg(output->bg_pid);
+ output->bg_pid = 0;
+ }
+ output_disable(output);
+ wlr_output_layout_remove(root->output_layout, wlr_output);
+ }
+ wlr_output_enable(wlr_output, false);
+ return;
+ } else if (!output->enabled) {
+ if (!oc || oc->dpms_state != DPMS_OFF) {
+ wlr_output_enable(wlr_output, true);
}
- output_disable(output);
- wlr_output_layout_remove(root->output_layout, wlr_output);
+ output_enable(output, oc);
return;
}
@@ -251,7 +260,7 @@ void apply_output_config(struct output_config *oc, struct sway_output *output) {
free(command);
}
}
- if (oc && oc->dpms_state != DPMS_IGNORE) {
+ if (oc) {
switch (oc->dpms_state) {
case DPMS_ON:
wlr_log(WLR_DEBUG, "Turning on screen");
@@ -292,17 +301,6 @@ void apply_output_config_to_outputs(struct output_config *oc) {
char *name = sway_output->wlr_output->name;
output_get_identifier(id, sizeof(id), sway_output);
if (wildcard || !strcmp(name, oc->name) || !strcmp(id, oc->name)) {
- if (!sway_output->enabled) {
- if (!oc->enabled) {
- if (!wildcard) {
- break;
- }
- continue;
- }
-
- output_enable(sway_output, oc);
- }
-
struct output_config *current = oc;
if (wildcard) {
struct output_config *tmp = get_output_config(name, id);