mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-03 09:01:47 -05:00
feat: add option no_border_when_single=1
This commit is contained in:
parent
11313d9e17
commit
0e527298c5
4 changed files with 28 additions and 0 deletions
21
src/maomao.c
21
src/maomao.c
|
|
@ -1048,6 +1048,9 @@ void set_rect_size(struct wlr_scene_rect *rect, int width, int height) {
|
|||
void apply_border(Client *c, struct wlr_box clip_box, int offsetx,
|
||||
int offsety) {
|
||||
int i;
|
||||
int num = 0;
|
||||
Client *ec;
|
||||
|
||||
if (c->iskilling || !client_surface(c)->mapped)
|
||||
return;
|
||||
|
||||
|
|
@ -1078,6 +1081,24 @@ void apply_border(Client *c, struct wlr_box clip_box, int offsetx,
|
|||
}
|
||||
}
|
||||
|
||||
if(no_border_when_single) {
|
||||
wl_list_for_each(ec, &clients, link) {
|
||||
if (c->iskilling || !client_surface(c)->mapped)
|
||||
continue;
|
||||
|
||||
if (ec != c && ec->tags & c->mon->tagset[c->mon->seltags])
|
||||
num++;
|
||||
}
|
||||
|
||||
if (num == 0) {
|
||||
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);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
|
||||
set_rect_size(c->border[0], clip_box.width, c->bw);
|
||||
set_rect_size(c->border[1], clip_box.width, c->bw);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue