aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorsghctoma <sghctoma@gmail.com>2018-09-03 08:57:17 +0200
committersghctoma <sghctoma@gmail.com>2018-09-03 08:57:17 +0200
commitdf730a88919b078093dbc322926ada219a60d036 (patch)
treef2837f24092c7be5dfccdf448e47062cb5718549 /sway/commands
parent67188b7cba2a985926647e049ed32c72b6ee98c8 (diff)
parentc9276f04c9fae7a211164003bc9cb8b4369db5fd (diff)
downloadsway-df730a88919b078093dbc322926ada219a60d036.tar.xz
Merge remote-tracking branch 'upstream/master' into fix-freebsd-build
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)
bool reload = false;
// if this is a reload command we need to make a duplicate of the
// binding since it will be gone after the reload has completed.
- if (strcasecmp(binding->command, "reload") == 0) {
+ if (strcasestr(binding->command, "reload")) {
reload = true;
binding_copy = sway_binding_dup(binding);
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) {
view->border = B_NORMAL;
} else if (strcmp(argv[0], "pixel") == 0) {
view->border = B_PIXEL;
- if (argc == 2) {
- view->border_thickness = atoi(argv[1]);
- }
} else if (strcmp(argv[0], "toggle") == 0) {
view->border = (view->border + 1) % 3;
} else {
@@ -37,6 +34,9 @@ struct cmd_results *cmd_border(int argc, char **argv) {
"Expected 'border <none|normal|pixel|toggle>' "
"or 'border pixel <px>'");
}
+ if (argc == 2) {
+ view->border_thickness = atoi(argv[1]);
+ }
if (container_is_floating(view->swayc)) {
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 @@
+#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);
+}