sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 02aeb0f0bec90f87acbdbce41d34109b26e9dc5d
parent 36d9037f2c419756b00d1fe2dbeefca278bc2799
Author: Brian Ashworth <RedSoxFan@users.noreply.github.com>
Date:   Sat, 13 Oct 2018 18:08:23 -0400

Merge branch 'master' into fix_edge_gaps
Diffstat:
Msway/tree/arrange.c | 4++++
Msway/tree/view.c | 11++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c @@ -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", diff --git a/sway/tree/view.c b/sway/tree/view.c @@ -504,7 +504,16 @@ static struct sway_workspace *select_workspace(struct sway_view *view) { } // Use the focused workspace - return seat_get_focused_workspace(seat); + struct sway_node *node = seat_get_focus_inactive(seat, &root->node); + if (node && node->type == N_WORKSPACE) { + return node->sway_workspace; + } else if (node && node->type == N_CONTAINER) { + return node->sway_container->workspace; + } + + // If there's no focus_inactive workspace then we must be running without + // any outputs connected + return root->saved_workspaces->items[0]; } static bool should_focus(struct sway_view *view) {