Merge remote-tracking branch 'upstream/master' into fix-freebsd-build

This commit is contained in:
sghctoma 2018-09-03 08:57:17 +02:00
commit df730a8891
22 changed files with 173 additions and 34 deletions

View file

@ -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) {

View file

@ -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);

View file

@ -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);
}