diff --git a/src/layout/layout.h b/src/layout/layout.h index cff287c..e976f02 100644 --- a/src/layout/layout.h +++ b/src/layout/layout.h @@ -31,7 +31,7 @@ void fibonacci(Monitor *mon, int s) { c->isfullscreen || c->ismaxmizescreen || c->animation.tagouting) continue; - c->bw = mon->visible_clients == 1 && no_border_when_single ? 0 : borderpx; + c->bw = mon->visible_clients == 1 && no_border_when_single && smartgaps ? 0 : borderpx; if ((i % 2 && nh / 2 > 2 * c->bw) || (!(i % 2) && nw / 2 > 2 * c->bw)) { if (i < n - 1) { if (i % 2) { @@ -147,7 +147,7 @@ void grid(Monitor *m) { if (n == 1) { wl_list_for_each(c, &clients, link) { - c->bw = m->visible_clients == 1 && no_border_when_single ? 0 : borderpx; + c->bw = m->visible_clients == 1 && no_border_when_single && smartgaps ? 0 : borderpx; if (VISIBLEON(c, c->mon) && !c->iskilling && !c->animation.tagouting && c->mon == selmon) { cw = (m->w.width - 2 * overviewgappo) * 0.7; @@ -167,7 +167,7 @@ void grid(Monitor *m) { ch = (m->w.height - 2 * overviewgappo) * 0.65; i = 0; wl_list_for_each(c, &clients, link) { - c->bw = m->visible_clients == 1 && no_border_when_single ? 0 : borderpx; + c->bw = m->visible_clients == 1 && no_border_when_single && smartgaps ? 0 : borderpx; if (VISIBLEON(c, c->mon) && !c->iskilling && !c->animation.tagouting && c->mon == selmon) { if (i == 0) { @@ -211,7 +211,7 @@ void grid(Monitor *m) { // 调整每个客户端的位置和大小 i = 0; wl_list_for_each(c, &clients, link) { - c->bw = m->visible_clients == 1 && no_border_when_single ? 0 : borderpx; + c->bw = m->visible_clients == 1 && no_border_when_single && smartgaps ? 0 : borderpx; if (VISIBLEON(c, c->mon) && !c->iskilling && !c->animation.tagouting && c->mon == selmon) { cx = m->w.x + (i % cols) * (cw + overviewgappi); diff --git a/src/maomao.c b/src/maomao.c index 1c8301b..7e322c1 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -1079,8 +1079,16 @@ void apply_border(Client *c, struct wlr_box clip_box, int offsetx, hit_no_border = true; } - if(hit_no_border) { + if(hit_no_border && smartgaps) { c->bw = 0; + } else if (hit_no_border && !smartgaps) { + set_rect_size(c->border[0], 0, 0); + set_rect_size(c->border[1], 0, 0); + set_rect_size(c->border[2], 0, 0); + set_rect_size(c->border[3], 0, 0); + wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw); + + return; } else if(!c->isfullscreen && VISIBLEON(c, c->mon)) { c->bw = borderpx; }