diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-05-28 11:09:46 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-05-28 11:09:46 -0400 |
commit | c81d0ef1e8922ad34d431e5dae430b90b0b21d7b (patch) | |
tree | d26eaaeb6eff22539746a29fefb1e934943b578a /sway/commands/force_focus_wrapping.c | |
parent | Merge pull request #2060 from RedSoxFan/focus-wrapping (diff) | |
download | sway-c81d0ef1e8922ad34d431e5dae430b90b0b21d7b.tar.gz sway-c81d0ef1e8922ad34d431e5dae430b90b0b21d7b.tar.zst sway-c81d0ef1e8922ad34d431e5dae430b90b0b21d7b.zip |
Support i3's legacy force_focus_wrapping command
Diffstat (limited to 'sway/commands/force_focus_wrapping.c')
-rw-r--r-- | sway/commands/force_focus_wrapping.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sway/commands/force_focus_wrapping.c b/sway/commands/force_focus_wrapping.c new file mode 100644 index 00000000..bc1d067f --- /dev/null +++ b/sway/commands/force_focus_wrapping.c | |||
@@ -0,0 +1,22 @@ | |||
1 | #include <strings.h> | ||
2 | #include "sway/commands.h" | ||
3 | #include "sway/config.h" | ||
4 | |||
5 | struct cmd_results *cmd_force_focus_wrapping(int argc, char **argv) { | ||
6 | struct cmd_results *error = | ||
7 | checkarg(argc, "force_focus_wrapping", EXPECTED_EQUAL_TO, 1); | ||
8 | if (error) { | ||
9 | return error; | ||
10 | } | ||
11 | |||
12 | if (strcasecmp(argv[0], "no") == 0) { | ||
13 | config->focus_wrapping = WRAP_YES; | ||
14 | } else if (strcasecmp(argv[0], "yes") == 0) { | ||
15 | config->focus_wrapping = WRAP_FORCE; | ||
16 | } else { | ||
17 | return cmd_results_new(CMD_INVALID, "force_focus_wrapping", | ||
18 | "Expected 'force_focus_wrapping yes|no'"); | ||
19 | } | ||
20 | |||
21 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
22 | } | ||