aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Christoph Gysin <christoph.gysin@gmail.com>2015-11-29 23:17:42 +0200
committerLibravatar Christoph Gysin <christoph.gysin@gmail.com>2015-11-29 23:17:55 +0200
commitae7ed795730398d50e6408575a1edfbd5c34bd3c (patch)
tree365d13bf0c0d8aae3aaec69bb6159ccd5cd91000 /sway
parentAdd text rendering support to wayland clients (diff)
downloadsway-ae7ed795730398d50e6408575a1edfbd5c34bd3c.tar.gz
sway-ae7ed795730398d50e6408575a1edfbd5c34bd3c.tar.zst
sway-ae7ed795730398d50e6408575a1edfbd5c34bd3c.zip
config: Store 'enabled' as int
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/commands.c b/sway/commands.c
index ba42a9ae..f891792f 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -719,7 +719,7 @@ static struct cmd_results *cmd_output(int argc, char **argv) {
719 struct output_config *output = calloc(1, sizeof(struct output_config)); 719 struct output_config *output = calloc(1, sizeof(struct output_config));
720 output->x = output->y = output->width = output->height = -1; 720 output->x = output->y = output->width = output->height = -1;
721 output->name = strdup(name); 721 output->name = strdup(name);
722 output->enabled = true; 722 output->enabled = -1;
723 723
724 // TODO: atoi doesn't handle invalid numbers 724 // TODO: atoi doesn't handle invalid numbers
725 // TODO: Check missing params after each sub-command 725 // TODO: Check missing params after each sub-command
@@ -729,7 +729,7 @@ static struct cmd_results *cmd_output(int argc, char **argv) {
729 const char *command = argv[i]; 729 const char *command = argv[i];
730 730
731 if (strcasecmp(command, "disable") == 0) { 731 if (strcasecmp(command, "disable") == 0) {
732 output->enabled = false; 732 output->enabled = 0;
733 } else if (strcasecmp(command, "resolution") == 0 || strcasecmp(command, "res") == 0) { 733 } else if (strcasecmp(command, "resolution") == 0 || strcasecmp(command, "res") == 0) {
734 char *res = argv[++i]; 734 char *res = argv[++i];
735 char *x = strchr(res, 'x'); 735 char *x = strchr(res, 'x');
@@ -811,8 +811,8 @@ static struct cmd_results *cmd_output(int argc, char **argv) {
811 } 811 }
812 list_add(config->output_configs, output); 812 list_add(config->output_configs, output);
813 813
814 sway_log(L_DEBUG, "Config stored for output %s (%s) (%d x %d @ %d, %d) (bg %s %s)", 814 sway_log(L_DEBUG, "Config stored for output %s (enabled:%d) (%d x %d @ %d, %d) (bg %s %s)",
815 output->name, output->enabled ? "enable" : "disable", output->width, 815 output->name, output->enabled, output->width,
816 output->height, output->x, output->y, output->background, 816 output->height, output->x, output->y, output->background,
817 output->background_option); 817 output->background_option);
818 818