diff options
author | Brian Ashworth <RedSoxFan@users.noreply.github.com> | 2018-05-14 00:28:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 00:28:21 -0400 |
commit | 34b864fb1752fde2528db6aa86d53c23412a8f43 (patch) | |
tree | b387f1e1eb8f8fc16faeb4bf24a0ab6e8ba5787c /sway/config | |
parent | 6ff7c5273659061ec4ff2f6c79c69af2d4d165a5 (diff) | |
parent | 270c1ee7e507f1d2960920a7f4f0cc70f4e13d26 (diff) | |
download | sway-34b864fb1752fde2528db6aa86d53c23412a8f43.tar.xz |
Merge branch 'master' into fix-1975
Diffstat (limited to 'sway/config')
-rw-r--r-- | sway/config/output.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index 68022278..ee2440ea 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -81,6 +81,9 @@ void merge_output_config(struct output_config *dst, struct output_config *src) { free(dst->background_option); dst->background_option = strdup(src->background_option); } + if (src->dpms_state != 0) { + dst->dpms_state = src->dpms_state; + } } static void set_mode(struct wlr_output *output, int width, int height, @@ -204,6 +207,20 @@ void apply_output_config(struct output_config *oc, struct sway_container *output execvp(cmd[0], cmd); } } + if (oc && oc->dpms_state != DPMS_IGNORE) { + switch (oc->dpms_state) { + case DPMS_ON: + wlr_log(L_DEBUG, "Turning on screen"); + wlr_output_enable(wlr_output, true); + break; + case DPMS_OFF: + wlr_log(L_DEBUG, "Turning off screen"); + wlr_output_enable(wlr_output, false); + break; + case DPMS_IGNORE: + break; + } + } } void free_output_config(struct output_config *oc) { |