aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/bind.c2
-rw-r--r--sway/commands/border.c6
-rw-r--r--sway/commands/focus_on_window_activation.c25
3 files changed, 29 insertions, 4 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 8270b958..b134c92f 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -310,7 +310,7 @@ void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding)
310 bool reload = false; 310 bool reload = false;
311 // if this is a reload command we need to make a duplicate of the 311 // if this is a reload command we need to make a duplicate of the
312 // binding since it will be gone after the reload has completed. 312 // binding since it will be gone after the reload has completed.
313 if (strcasecmp(binding->command, "reload") == 0) { 313 if (strcasestr(binding->command, "reload")) {
314 reload = true; 314 reload = true;
315 binding_copy = sway_binding_dup(binding); 315 binding_copy = sway_binding_dup(binding);
316 if (!binding_copy) { 316 if (!binding_copy) {
diff --git a/sway/commands/border.c b/sway/commands/border.c
index 9c19e20a..9502c877 100644
--- a/sway/commands/border.c
+++ b/sway/commands/border.c
@@ -27,9 +27,6 @@ struct cmd_results *cmd_border(int argc, char **argv) {
27 view->border = B_NORMAL; 27 view->border = B_NORMAL;
28 } else if (strcmp(argv[0], "pixel") == 0) { 28 } else if (strcmp(argv[0], "pixel") == 0) {
29 view->border = B_PIXEL; 29 view->border = B_PIXEL;
30 if (argc == 2) {
31 view->border_thickness = atoi(argv[1]);
32 }
33 } else if (strcmp(argv[0], "toggle") == 0) { 30 } else if (strcmp(argv[0], "toggle") == 0) {
34 view->border = (view->border + 1) % 3; 31 view->border = (view->border + 1) % 3;
35 } else { 32 } else {
@@ -37,6 +34,9 @@ struct cmd_results *cmd_border(int argc, char **argv) {
37 "Expected 'border <none|normal|pixel|toggle>' " 34 "Expected 'border <none|normal|pixel|toggle>' "
38 "or 'border pixel <px>'"); 35 "or 'border pixel <px>'");
39 } 36 }
37 if (argc == 2) {
38 view->border_thickness = atoi(argv[1]);
39 }
40 40
41 if (container_is_floating(view->swayc)) { 41 if (container_is_floating(view->swayc)) {
42 container_set_geometry_from_floating_view(view->swayc); 42 container_set_geometry_from_floating_view(view->swayc);
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}