mirror of
https://github.com/swaywm/sway.git
synced 2026-04-03 07:15:39 -04:00
Remove internal references to DPMS
While at it, use an int for the config field, just like we do for all other fields.
This commit is contained in:
parent
798e3c8858
commit
b69d637f7a
5 changed files with 22 additions and 27 deletions
|
|
@ -12,7 +12,7 @@ struct cmd_results *output_cmd_power(int argc, char **argv) {
|
|||
return cmd_results_new(CMD_INVALID, "Missing power argument");
|
||||
}
|
||||
|
||||
enum config_dpms current_dpms = DPMS_ON;
|
||||
bool current = true;
|
||||
if (strcasecmp(argv[0], "toggle") == 0) {
|
||||
const char *oc_name = config->handler_context.output_config->name;
|
||||
if (strcmp(oc_name, "*") == 0) {
|
||||
|
|
@ -27,14 +27,14 @@ struct cmd_results *output_cmd_power(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (sway_output->enabled && !sway_output->wlr_output->enabled) {
|
||||
current_dpms = DPMS_OFF;
|
||||
current = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (parse_boolean(argv[0], current_dpms == DPMS_ON)) {
|
||||
config->handler_context.output_config->dpms_state = DPMS_ON;
|
||||
if (parse_boolean(argv[0], current)) {
|
||||
config->handler_context.output_config->power = 1;
|
||||
} else {
|
||||
config->handler_context.output_config->dpms_state = DPMS_OFF;
|
||||
config->handler_context.output_config->power = 0;
|
||||
}
|
||||
|
||||
config->handler_context.leftovers.argc = argc - 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue