diff options
author | Brian Ashworth <[email protected]> | 2018-10-01 09:41:15 -0400 |
---|---|---|
committer | Brian Ashworth <[email protected]> | 2018-10-01 09:41:15 -0400 |
commit | 742d1764a6fb1fb9269dc9ffe08319da98f4d7b8 (patch) | |
tree | 9a9dbe4dd968f78e728496a33e17bf695c773dcd /sway/tree/workspace.c | |
parent | 51f68e10ad8bd42925dda24d06a6f6fccf3e6a39 (diff) |
Fix smart gaps
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 9dd5c815..e9e5dfa2 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -640,11 +640,17 @@ void workspace_add_gaps(struct sway_workspace *ws) { if (ws->current_gaps > 0) { return; } - bool should_apply = - config->edge_gaps || (config->smart_gaps && ws->tiling->length > 1); - if (!should_apply) { + if (!config->edge_gaps) { return; } + if (config->smart_gaps) { + struct sway_seat *seat = input_manager_get_default_seat(input_manager); + struct sway_container *focus = + seat_get_focus_inactive_view(seat, &ws->node); + if (focus && focus->view && view_is_only_visible(focus->view)) { + return; + } + } ws->current_gaps = ws->gaps_outer; |