diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-13 19:15:04 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-13 19:15:04 +1000 |
commit | 9190735947947f5afa21f725cfe0569abde946aa (patch) | |
tree | 1b206c8e09ff9e084f92981e8d01b2aab8a5e42e /sway/tree/arrange.c | |
parent | Merge pull request #2825 from RyanDwyer/fractional-scale-pixel-leaks (diff) | |
download | sway-9190735947947f5afa21f725cfe0569abde946aa.tar.gz sway-9190735947947f5afa21f725cfe0569abde946aa.tar.zst sway-9190735947947f5afa21f725cfe0569abde946aa.zip |
Fix crash when view maps while locked
When locked, there is no active workspace so it must find the
focus_inactive workspace instead.
Additionally, this adds a check for if a view maps while there are no
outputs connected and handles it gracefully.
Diffstat (limited to 'sway/tree/arrange.c')
-rw-r--r-- | sway/tree/arrange.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index 373460a2..852d53bf 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c | |||
@@ -180,6 +180,10 @@ void arrange_workspace(struct sway_workspace *workspace) { | |||
180 | if (config->reloading) { | 180 | if (config->reloading) { |
181 | return; | 181 | return; |
182 | } | 182 | } |
183 | if (!workspace->output) { | ||
184 | // Happens when there are no outputs connected | ||
185 | return; | ||
186 | } | ||
183 | struct sway_output *output = workspace->output; | 187 | struct sway_output *output = workspace->output; |
184 | struct wlr_box *area = &output->usable_area; | 188 | struct wlr_box *area = &output->usable_area; |
185 | wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d", | 189 | wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d", |