diff options
author | emersion <contact@emersion.fr> | 2018-05-28 17:01:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-28 17:01:34 +0100 |
commit | 96d575b2525770ec542ea691fc654a3ab1ab2420 (patch) | |
tree | d26eaaeb6eff22539746a29fefb1e934943b578a /sway | |
parent | Merge pull request #2060 from RedSoxFan/focus-wrapping (diff) | |
parent | Support i3's legacy force_focus_wrapping command (diff) | |
download | sway-96d575b2525770ec542ea691fc654a3ab1ab2420.tar.gz sway-96d575b2525770ec542ea691fc654a3ab1ab2420.tar.zst sway-96d575b2525770ec542ea691fc654a3ab1ab2420.zip |
Merge pull request #2066 from RedSoxFan/force-focus-wrapping
Support i3's legacy force_focus_wrapping command
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 1 | ||||
-rw-r--r-- | sway/commands/force_focus_wrapping.c | 22 | ||||
-rw-r--r-- | sway/meson.build | 1 | ||||
-rw-r--r-- | sway/sway.5.scd | 6 |
4 files changed, 30 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c index be16a4b4..b55ea58c 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -109,6 +109,7 @@ static struct cmd_handler handlers[] = { | |||
109 | { "focus_wrapping", cmd_focus_wrapping }, | 109 | { "focus_wrapping", cmd_focus_wrapping }, |
110 | { "font", cmd_font }, | 110 | { "font", cmd_font }, |
111 | { "for_window", cmd_for_window }, | 111 | { "for_window", cmd_for_window }, |
112 | { "force_focus_wrapping", cmd_force_focus_wrapping }, | ||
112 | { "fullscreen", cmd_fullscreen }, | 113 | { "fullscreen", cmd_fullscreen }, |
113 | { "hide_edge_borders", cmd_hide_edge_borders }, | 114 | { "hide_edge_borders", cmd_hide_edge_borders }, |
114 | { "include", cmd_include }, | 115 | { "include", cmd_include }, |
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 | } | ||
diff --git a/sway/meson.build b/sway/meson.build index 76c312ba..e5878b9e 100644 --- a/sway/meson.build +++ b/sway/meson.build | |||
@@ -41,6 +41,7 @@ sway_sources = files( | |||
41 | 'commands/focus_wrapping.c', | 41 | 'commands/focus_wrapping.c', |
42 | 'commands/font.c', | 42 | 'commands/font.c', |
43 | 'commands/for_window.c', | 43 | 'commands/for_window.c', |
44 | 'commands/force_focus_wrapping.c', | ||
44 | 'commands/fullscreen.c', | 45 | 'commands/fullscreen.c', |
45 | 'commands/hide_edge_borders.c', | 46 | 'commands/hide_edge_borders.c', |
46 | 'commands/kill.c', | 47 | 'commands/kill.c', |
diff --git a/sway/sway.5.scd b/sway/sway.5.scd index 10990fc4..5ce6bf06 100644 --- a/sway/sway.5.scd +++ b/sway/sway.5.scd | |||
@@ -344,6 +344,12 @@ The default colors are: | |||
344 | Whenever a window that matches _criteria_ appears, run list of commands. | 344 | Whenever a window that matches _criteria_ appears, run list of commands. |
345 | See *CRITERIA* for more details. | 345 | See *CRITERIA* for more details. |
346 | 346 | ||
347 | *force\_focus\_wrapping* yes|no | ||
348 | This option is a wrapper to support i3's legacy syntax. _no_ is equivalent | ||
349 | to _focus\_wrapping yes_ and _yes_ is equivalent to | ||
350 | _focus\_wrapping force_. This is only available for convenience. Please | ||
351 | use _focus\_wrapping_ instead when possible. | ||
352 | |||
347 | *gaps* edge\_gaps on|off|toggle | 353 | *gaps* edge\_gaps on|off|toggle |
348 | When _on_, gaps will be added between windows and workspace edges if the | 354 | When _on_, gaps will be added between windows and workspace edges if the |
349 | inner gap is nonzero. When _off_, gaps will only be added between views. | 355 | inner gap is nonzero. When _off_, gaps will only be added between views. |