diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-07-23 21:49:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-23 21:49:16 -0400 |
commit | 71774ecd3658653328f3c903869b52c51c62e237 (patch) | |
tree | bfc136252f81a5350f240c20161d2d0bfc2f80dd /sway/commands/input/middle_emulation.c | |
parent | 224ade138208e9aa525423cbfbd643aa9d9b63c3 (diff) | |
parent | 9ec1d6cf79e6f9c3233f577c6fddeaeb21bb1bfc (diff) |
Merge pull request #2340 from RedSoxFan/parse_boolean
Switch to using a function to parse booleans
Diffstat (limited to 'sway/commands/input/middle_emulation.c')
-rw-r--r-- | sway/commands/input/middle_emulation.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sway/commands/input/middle_emulation.c b/sway/commands/input/middle_emulation.c index 7ca01629..414d4d2b 100644 --- a/sway/commands/input/middle_emulation.c +++ b/sway/commands/input/middle_emulation.c @@ -3,6 +3,7 @@ #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" +#include "util.h" struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) { struct cmd_results *error = NULL; @@ -18,15 +19,11 @@ struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) { struct input_config *new_config = new_input_config(current_input_config->identifier); - if (strcasecmp(argv[0], "enabled") == 0) { + if (parse_boolean(argv[0], true)) { new_config->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED; - } else if (strcasecmp(argv[0], "disabled") == 0) { + } else { new_config->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED; - } else { - free_input_config(new_config); - return cmd_results_new(CMD_INVALID, "middle_emulation", - "Expected 'middle_emulation <enabled|disabled>'"); } apply_input_config(new_config); |