From 67866dc3785453ad0ac97d14858c9176cbcca966 Mon Sep 17 00:00:00 2001 From: mwenzkowski <29407878+mwenzkowski@users.noreply.github.com> Date: Sun, 4 Nov 2018 20:40:14 +0100 Subject: gaps: Improve error reporting Always raise an error if the runtime only gaps command is found in the config file. --- sway/commands/gaps.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'sway/commands') diff --git a/sway/commands/gaps.c b/sway/commands/gaps.c index ca8cb27a..3f0ef155 100644 --- a/sway/commands/gaps.c +++ b/sway/commands/gaps.c @@ -149,16 +149,17 @@ struct cmd_results *cmd_gaps(int argc, char **argv) { return error; } + bool config_loading = !config->active || config->reloading; + if (argc == 2) { return gaps_set_defaults(argc, argv); } - if (argc == 4) { - if (config->active) { - return gaps_set_runtime(argc, argv); - } else { - return cmd_results_new(CMD_INVALID, "gaps", - "This syntax can only be used when sway is running"); - } + if (argc == 4 && !config_loading) { + return gaps_set_runtime(argc, argv); + } + if (config_loading) { + return cmd_results_new(CMD_INVALID, "gaps", + "Expected 'gaps inner|outer '"); } return cmd_results_new(CMD_INVALID, "gaps", "Expected 'gaps inner|outer ' or " -- cgit v1.2.3 From c8c1ecaf258188266161832991fc52999eddbfc7 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 5 Nov 2018 12:39:44 -0500 Subject: Fix focus_wrapping yes It appears that the focus code that handles `focus_wrapping yes` was removed during the conversion to type safety. This re-implements the focus code for when `focus_wrapping` is set to `yes` (default). Neither the `no` or `force` options appear to be effected and should be working. --- sway/commands/focus.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sway/commands') diff --git a/sway/commands/focus.c b/sway/commands/focus.c index cef92144..f6338c55 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c @@ -156,6 +156,14 @@ static struct sway_node *node_get_in_direction(struct sway_container *container, if (new_output) { return get_node_in_output_direction(new_output, dir); } + + // If there is a wrap candidate, return its focus inactive view + if (wrap_candidate) { + struct sway_container *wrap_inactive = seat_get_focus_inactive_view( + seat, &wrap_candidate->node); + return &wrap_inactive->node; + } + return NULL; } -- cgit v1.2.3 From 5fdffea99ac5fcfd3618256a0291c9ff71cb1480 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Mon, 5 Nov 2018 20:28:59 +0100 Subject: commands/exec_always: defer command on config validation The exec_always command was executed twice, since it was not checking for the config->validating variable. Fix this by defering the command if the configuration is validating. Fixes #3072 --- sway/commands/exec_always.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/commands') diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 8bdeceeb..7a15709b 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -15,7 +15,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { struct cmd_results *error = NULL; - if (!config->active) return cmd_results_new(CMD_DEFER, NULL, NULL); + if (!config->active || config->validating) return cmd_results_new(CMD_DEFER, NULL, NULL); if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { return error; } -- cgit v1.2.3