aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/focus_follows_mouse.c
diff options
context:
space:
mode:
authorLibravatar Connor E <38229097+c-edw@users.noreply.github.com>2018-11-06 20:58:08 +0000
committerLibravatar emersion <contact@emersion.fr>2018-11-06 21:58:08 +0100
commit4a21981855a340c549db99d286590c369895da87 (patch)
tree76c83b88d97471f871454e828b403f27043a6876 /sway/commands/focus_follows_mouse.c
parentMerge pull request #3046 from tokyovigilante/relative-transform (diff)
downloadsway-4a21981855a340c549db99d286590c369895da87.tar.gz
sway-4a21981855a340c549db99d286590c369895da87.tar.zst
sway-4a21981855a340c549db99d286590c369895da87.zip
Add focus_follows_mouse always. (#3081)
* Add focus_follows_mouse_mode. * Fail if focus_follows_mouse is invalid. * Fix indentation.
Diffstat (limited to 'sway/commands/focus_follows_mouse.c')
-rw-r--r--sway/commands/focus_follows_mouse.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sway/commands/focus_follows_mouse.c b/sway/commands/focus_follows_mouse.c
index 0b0e334c..d0d2cb8a 100644
--- a/sway/commands/focus_follows_mouse.c
+++ b/sway/commands/focus_follows_mouse.c
@@ -7,8 +7,15 @@ struct cmd_results *cmd_focus_follows_mouse(int argc, char **argv) {
7 struct cmd_results *error = NULL; 7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "focus_follows_mouse", EXPECTED_EQUAL_TO, 1))) { 8 if ((error = checkarg(argc, "focus_follows_mouse", EXPECTED_EQUAL_TO, 1))) {
9 return error; 9 return error;
10 } else if(strcmp(argv[0], "no") == 0) {
11 config->focus_follows_mouse = FOLLOWS_NO;
12 } else if(strcmp(argv[0], "yes") == 0) {
13 config->focus_follows_mouse = FOLLOWS_YES;
14 } else if(strcmp(argv[0], "always") == 0) {
15 config->focus_follows_mouse = FOLLOWS_ALWAYS;
16 } else {
17 return cmd_results_new(CMD_FAILURE, "focus_follows_mouse",
18 "Expected 'focus_follows_mouse no|yes|always'");
10 } 19 }
11 config->focus_follows_mouse =
12 parse_boolean(argv[0], config->focus_follows_mouse);
13 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 20 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
14} 21}