aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/focus_on_window_activation.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-02 15:03:58 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-02 18:20:34 +1000
commitf057a0195ee79dfcaeddbcab026c06e310998c75 (patch)
tree5c09cc286ae3a6d852341a0ae4796d28bb6155b0 /sway/commands/focus_on_window_activation.c
parentMerge pull request #2559 from RyanDwyer/xwayland-check-modal (diff)
downloadsway-f057a0195ee79dfcaeddbcab026c06e310998c75.tar.gz
sway-f057a0195ee79dfcaeddbcab026c06e310998c75.tar.zst
sway-f057a0195ee79dfcaeddbcab026c06e310998c75.zip
Implement focus_on_window_activation
Depends on https://github.com/swaywm/wlroots/pull/1223
Diffstat (limited to 'sway/commands/focus_on_window_activation.c')
-rw-r--r--sway/commands/focus_on_window_activation.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/commands/focus_on_window_activation.c b/sway/commands/focus_on_window_activation.c
new file mode 100644
index 00000000..1fb07918
--- /dev/null
+++ b/sway/commands/focus_on_window_activation.c
@@ -0,0 +1,25 @@
1#include "sway/commands.h"
2
3struct cmd_results *cmd_focus_on_window_activation(int argc, char **argv) {
4 struct cmd_results *error = NULL;
5 if ((error = checkarg(argc, "focus_on_window_activation",
6 EXPECTED_EQUAL_TO, 1))) {
7 return error;
8 }
9
10 if (strcmp(argv[0], "smart") == 0) {
11 config->focus_on_window_activation = FOWA_SMART;
12 } else if (strcmp(argv[0], "urgent") == 0) {
13 config->focus_on_window_activation = FOWA_URGENT;
14 } else if (strcmp(argv[0], "focus") == 0) {
15 config->focus_on_window_activation = FOWA_FOCUS;
16 } else if (strcmp(argv[0], "none") == 0) {
17 config->focus_on_window_activation = FOWA_NONE;
18 } else {
19 return cmd_results_new(CMD_INVALID, "focus_on_window_activation",
20 "Expected "
21 "'focus_on_window_activation smart|urgent|focus|none'");
22 }
23
24 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
25}