diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-30 21:26:21 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-05 18:01:43 +1000 |
commit | 0df04e27b6d865baa776c3492f08b5db8f59e6ed (patch) | |
tree | f2c59999327f64e31f2e1b76ff2a56f5867bbbd4 | |
parent | Don't use wlr_output properties (diff) | |
download | sway-0df04e27b6d865baa776c3492f08b5db8f59e6ed.tar.gz sway-0df04e27b6d865baa776c3492f08b5db8f59e6ed.tar.zst sway-0df04e27b6d865baa776c3492f08b5db8f59e6ed.zip |
Fix crash when focus hits edge of root
-rw-r--r-- | sway/commands/focus.c | 4 |
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) { | |||
255 | // A workspace is focused, so just jump to the next output | 255 | // A workspace is focused, so just jump to the next output |
256 | struct sway_output *new_output = | 256 | struct sway_output *new_output = |
257 | output_get_in_direction(workspace->output, direction); | 257 | output_get_in_direction(workspace->output, direction); |
258 | if (!new_output) { | ||
259 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
260 | } | ||
261 | |||
258 | struct sway_node *node = | 262 | struct sway_node *node = |
259 | get_node_in_output_direction(new_output, direction); | 263 | get_node_in_output_direction(new_output, direction); |
260 | seat_set_focus(seat, node); | 264 | seat_set_focus(seat, node); |