mirror of
https://github.com/swaywm/sway.git
synced 2026-03-12 05:34:29 -04:00
Fix smart gaps
This commit is contained in:
parent
51f68e10ad
commit
742d1764a6
5 changed files with 63 additions and 24 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue