aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorBrian Ashworth <RedSoxFan@users.noreply.github.com>2018-09-03 00:24:28 -0400
committerGitHub <noreply@github.com>2018-09-03 00:24:28 -0400
commitafb69688746b04d7667e1d57d9ac844bd2671570 (patch)
treef950fd298c335abd992005a26029dbfba8010136 /sway/commands
parent349d1f3be87ad9fd49482f64c71eb2665750261b (diff)
parent3af9588eb4aab0b4f45edf2601c9a7ff0846861f (diff)
downloadsway-afb69688746b04d7667e1d57d9ac844bd2671570.tar.xz
Merge branch 'master' into disabled-no-modeset
Diffstat (limited to 'sway/commands')
-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 @@
+#include "sway/commands.h"
+
+struct cmd_results *cmd_focus_on_window_activation(int argc, char **argv) {
+ struct cmd_results *error = NULL;
+ if ((error = checkarg(argc, "focus_on_window_activation",
+ EXPECTED_EQUAL_TO, 1))) {
+ return error;
+ }
+
+ if (strcmp(argv[0], "smart") == 0) {
+ config->focus_on_window_activation = FOWA_SMART;
+ } else if (strcmp(argv[0], "urgent") == 0) {
+ config->focus_on_window_activation = FOWA_URGENT;
+ } else if (strcmp(argv[0], "focus") == 0) {
+ config->focus_on_window_activation = FOWA_FOCUS;
+ } else if (strcmp(argv[0], "none") == 0) {
+ config->focus_on_window_activation = FOWA_NONE;
+ } else {
+ return cmd_results_new(CMD_INVALID, "focus_on_window_activation",
+ "Expected "
+ "'focus_on_window_activation smart|urgent|focus|none'");
+ }
+
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+}