diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-07-23 15:04:46 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-07-23 21:33:17 -0400 |
commit | 863914ec9574eb58cb0746d59f216997c4863cdf (patch) | |
tree | aaddd8ae854d1dde4b50cfd4ef470c1acf83b6ce /sway/commands/force_focus_wrapping.c | |
parent | Merge pull request #2342 from RyanDwyer/update-cursor (diff) | |
download | sway-863914ec9574eb58cb0746d59f216997c4863cdf.tar.gz sway-863914ec9574eb58cb0746d59f216997c4863cdf.tar.zst sway-863914ec9574eb58cb0746d59f216997c4863cdf.zip |
Switch to using a function to parse booleans
Diffstat (limited to 'sway/commands/force_focus_wrapping.c')
-rw-r--r-- | sway/commands/force_focus_wrapping.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/commands/force_focus_wrapping.c b/sway/commands/force_focus_wrapping.c index bc1d067f..0892d9e9 100644 --- a/sway/commands/force_focus_wrapping.c +++ b/sway/commands/force_focus_wrapping.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <strings.h> | 1 | #include <strings.h> |
2 | #include "sway/commands.h" | 2 | #include "sway/commands.h" |
3 | #include "sway/config.h" | 3 | #include "sway/config.h" |
4 | #include "util.h" | ||
4 | 5 | ||
5 | struct cmd_results *cmd_force_focus_wrapping(int argc, char **argv) { | 6 | struct cmd_results *cmd_force_focus_wrapping(int argc, char **argv) { |
6 | struct cmd_results *error = | 7 | struct cmd_results *error = |
@@ -9,13 +10,10 @@ struct cmd_results *cmd_force_focus_wrapping(int argc, char **argv) { | |||
9 | return error; | 10 | return error; |
10 | } | 11 | } |
11 | 12 | ||
12 | if (strcasecmp(argv[0], "no") == 0) { | 13 | if (parse_boolean(argv[0], config->focus_wrapping == WRAP_FORCE)) { |
13 | config->focus_wrapping = WRAP_YES; | ||
14 | } else if (strcasecmp(argv[0], "yes") == 0) { | ||
15 | config->focus_wrapping = WRAP_FORCE; | 14 | config->focus_wrapping = WRAP_FORCE; |
16 | } else { | 15 | } else { |
17 | return cmd_results_new(CMD_INVALID, "force_focus_wrapping", | 16 | config->focus_wrapping = WRAP_YES; |
18 | "Expected 'force_focus_wrapping yes|no'"); | ||
19 | } | 17 | } |
20 | 18 | ||
21 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 19 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |