aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/force_focus_wrapping.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-05-28 11:09:46 -0400
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-05-28 11:09:46 -0400
commitc81d0ef1e8922ad34d431e5dae430b90b0b21d7b (patch)
treed26eaaeb6eff22539746a29fefb1e934943b578a /sway/commands/force_focus_wrapping.c
parentMerge pull request #2060 from RedSoxFan/focus-wrapping (diff)
downloadsway-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.c22
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
5struct 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}