aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-08-30 21:26:21 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-09-05 18:01:43 +1000
commit0df04e27b6d865baa776c3492f08b5db8f59e6ed (patch)
treef2c59999327f64e31f2e1b76ff2a56f5867bbbd4 /sway/commands
parentacc2628c799170dea98380cda2237137137f182f (diff)
downloadsway-0df04e27b6d865baa776c3492f08b5db8f59e6ed.tar.xz
Fix crash when focus hits edge of root
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/focus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index e31898af..30cfa1c5 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -255,6 +255,10 @@ struct cmd_results *cmd_focus(int argc, char **argv) {
// A workspace is focused, so just jump to the next output
struct sway_output *new_output =
output_get_in_direction(workspace->output, direction);
+ if (!new_output) {
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+ }
+
struct sway_node *node =
get_node_in_output_direction(new_output, direction);
seat_set_focus(seat, node);