Skip to content

Commit

Permalink
Merge pull request #42 from roukaixin/pr
Browse files Browse the repository at this point in the history
fix: 仅一个tile窗口时,禁止切换是否展示边框
  • Loading branch information
yaocccc authored Mar 15, 2024
2 parents 903ca13 + 7f0de1b commit c42cd79
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2864,8 +2864,20 @@ toggleglobal(const Arg *arg)
void
toggleborder(const Arg *arg)
{
int client_count = 0;
Client *c = NULL;
// 判断当前是否选中客户端
if (!selmon->sel)
return;
// 判断是否只有一个窗口
for (c = selmon->clients; c; c = c->next) {
if (ISVISIBLE(c) && !HIDDEN(c)) {
client_count ++;
}
}
if (client_count == 1) {
return;
}
selmon->sel->isnoborder ^= 1;
selmon->sel->bw = selmon->sel->isnoborder ? 0 : borderpx;
int diff = (selmon->sel->isnoborder ? -1 : 1) * borderpx;
Expand Down

0 comments on commit c42cd79

Please sign in to comment.