diff options
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; |