diff options
author | Simon Ser <contact@emersion.fr> | 2020-01-27 18:39:29 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-02-26 16:26:13 +0100 |
commit | 5ed01c861a2e720d53b42f707872dbfb36b2fce7 (patch) | |
tree | f79301865db7d1707fe58c57ceadf3715295acd3 /sway/desktop/output.c | |
parent | e0f8235fbfd77d81eecb12295c89f5ad2758b68c (diff) |
Add support for wlr-output-power-management-unstable-v1
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index ec662a8c..f5c84d96 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -977,3 +977,21 @@ void handle_output_manager_test(struct wl_listener *listener, void *data) { wlr_output_configuration_v1_send_succeeded(config); wlr_output_configuration_v1_destroy(config); } + +void handle_output_power_manager_set_mode(struct wl_listener *listener, + void *data) { + struct wlr_output_power_v1_set_mode_event *event = data; + struct sway_output *output = event->output->data; + + struct output_config *oc = new_output_config(output->wlr_output->name); + switch (event->mode) { + case ZWLR_OUTPUT_POWER_V1_MODE_OFF: + oc->dpms_state = DPMS_OFF; + break; + case ZWLR_OUTPUT_POWER_V1_MODE_ON: + oc->dpms_state = DPMS_ON; + break; + } + oc = store_output_config(oc); + apply_output_config(oc, output); +} |