aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/focus.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-03-12 13:57:40 -0400
committerLibravatar emersion <contact@emersion.fr>2019-03-12 19:14:04 +0100
commit3330faded5ed59b19b2a1982bb52c05322b03510 (patch)
treef6acaeb4793ff21534e84ea5b9b37bf87ddf7f91 /sway/commands/focus.c
parentconfig.in: allow launch apps with args via dmenu (diff)
downloadsway-3330faded5ed59b19b2a1982bb52c05322b03510.tar.gz
sway-3330faded5ed59b19b2a1982bb52c05322b03510.tar.zst
sway-3330faded5ed59b19b2a1982bb52c05322b03510.zip
Handle seat_get_focused_workspace returning NULL
This modifiers the callers of seat_get_focused_workspace to handle getting NULL as the return value, if they did not already.
Diffstat (limited to 'sway/commands/focus.c')
-rw-r--r--sway/commands/focus.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c
index 25df5130..6344a765 100644
--- a/sway/commands/focus.c
+++ b/sway/commands/focus.c
@@ -208,6 +208,11 @@ static struct cmd_results *focus_output(struct sway_seat *seat,
208 "There is no output with that name"); 208 "There is no output with that name");
209 } 209 }
210 struct sway_workspace *ws = seat_get_focused_workspace(seat); 210 struct sway_workspace *ws = seat_get_focused_workspace(seat);
211 if (!ws) {
212 free(identifier);
213 return cmd_results_new(CMD_FAILURE,
214 "No focused workspace to base directions off of");
215 }
211 output = output_get_in_direction(ws->output, direction); 216 output = output_get_in_direction(ws->output, direction);
212 217
213 if (!output) { 218 if (!output) {