mirror of
https://github.com/swaywm/sway.git
synced 2025-11-17 06:59:48 -05:00
Switch to using a function to parse booleans
This commit is contained in:
parent
224ade1382
commit
863914ec95
15 changed files with 62 additions and 85 deletions
|
|
@ -1,12 +1,14 @@
|
|||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include "sway/commands.h"
|
||||
#include "util.h"
|
||||
|
||||
struct cmd_results *cmd_focus_follows_mouse(int argc, char **argv) {
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "focus_follows_mouse", EXPECTED_EQUAL_TO, 1))) {
|
||||
return error;
|
||||
}
|
||||
config->focus_follows_mouse = !strcasecmp(argv[0], "yes");
|
||||
config->focus_follows_mouse =
|
||||
parse_boolean(argv[0], config->focus_follows_mouse);
|
||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue