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.
This commit is contained in:
Ryan Dwyer 2018-10-13 19:15:04 +10:00
parent b80cf982ae
commit 9190735947
2 changed files with 14 additions and 1 deletions

View file

@ -180,6 +180,10 @@ void arrange_workspace(struct sway_workspace *workspace) {
if (config->reloading) {
return;
}
if (!workspace->output) {
// Happens when there are no outputs connected
return;
}
struct sway_output *output = workspace->output;
struct wlr_box *area = &output->usable_area;
wlr_log(WLR_DEBUG, "Usable area for ws: %dx%d@%d,%d",