diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2023-04-16 19:40:39 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-04-16 19:55:00 +0200 |
commit | 33cfdbe886144e8515593d96a80d850a7c6e382e (patch) | |
tree | 5d87a54891969966cb47991d259f361b34d62e45 /sway/desktop | |
parent | Use format_str() throughout (diff) | |
download | sway-33cfdbe886144e8515593d96a80d850a7c6e382e.tar.gz sway-33cfdbe886144e8515593d96a80d850a7c6e382e.tar.zst sway-33cfdbe886144e8515593d96a80d850a7c6e382e.zip |
xdg_shell: Fix crash if popup generates while toplevel is in the scratchpad
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/xdg_shell.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 8da922d5..9b6456da 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -67,7 +67,13 @@ static void popup_unconstrain(struct sway_xdg_popup *popup) { | |||
67 | struct sway_view *view = popup->child.view; | 67 | struct sway_view *view = popup->child.view; |
68 | struct wlr_xdg_popup *wlr_popup = popup->wlr_xdg_popup; | 68 | struct wlr_xdg_popup *wlr_popup = popup->wlr_xdg_popup; |
69 | 69 | ||
70 | struct sway_output *output = view->container->pending.workspace->output; | 70 | struct sway_workspace *workspace = view->container->pending.workspace; |
71 | if (!workspace) { | ||
72 | // is null if in the scratchpad | ||
73 | return; | ||
74 | } | ||
75 | |||
76 | struct sway_output *output = workspace->output; | ||
71 | 77 | ||
72 | // the output box expressed in the coordinate system of the toplevel parent | 78 | // the output box expressed in the coordinate system of the toplevel parent |
73 | // of the popup | 79 | // of the popup |