summaryrefslogtreecommitdiffstats
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
parentAdd text rendering support to wayland clients (diff)
downloadsway-ae7ed795730398d50e6408575a1edfbd5c34bd3c.tar.gz
sway-ae7ed795730398d50e6408575a1edfbd5c34bd3c.tar.zst
sway-ae7ed795730398d50e6408575a1edfbd5c34bd3c.zip
config: Store 'enabled' as int
-rw-r--r--include/config.h2
-rw-r--r--sway/commands.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/include/config.h b/include/config.h
index 9caadec8..631c8178 100644
--- a/include/config.h
+++ b/include/config.h
@@ -40,7 +40,7 @@ struct sway_mode {
40 */ 40 */
41struct output_config { 41struct output_config {
42 char *name; 42 char *name;
43 bool enabled; 43 int enabled;
44 int width, height; 44 int width, height;
45 int x, y; 45 int x, y;
46 char *background; 46 char *background;
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