aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/scratchpad.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/scratchpad.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/scratchpad.c')
-rw-r--r--sway/commands/scratchpad.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c
index 71afa306..34871bc6 100644
--- a/sway/commands/scratchpad.c
+++ b/sway/commands/scratchpad.c
@@ -12,6 +12,11 @@ static void scratchpad_toggle_auto(void) {
12 struct sway_seat *seat = input_manager_current_seat(); 12 struct sway_seat *seat = input_manager_current_seat();
13 struct sway_container *focus = seat_get_focused_container(seat); 13 struct sway_container *focus = seat_get_focused_container(seat);
14 struct sway_workspace *ws = seat_get_focused_workspace(seat); 14 struct sway_workspace *ws = seat_get_focused_workspace(seat);
15 if (!ws) {
16 sway_log(SWAY_DEBUG,
17 "No focused workspace to toggle scratchpad windows on");
18 return;
19 }
15 20
16 // If the focus is in a floating split container, 21 // If the focus is in a floating split container,
17 // operate on the split container instead of the child. 22 // operate on the split container instead of the child.