fix: overview toggle miss judge current monitor

This commit is contained in:
DreamMaoMao 2025-06-07 22:17:40 +08:00
parent c7060b546d
commit efbe677bee

View file

@ -134,7 +134,7 @@ void grid(Monitor *m) {
// 第一次遍历,计算 n 的值
wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, c->mon) && !c->isunglobal &&
if (VISIBLEON(c, m) && !c->isunglobal &&
(m->isoverview || ISTILED(c))) {
n++;
}
@ -150,7 +150,7 @@ void grid(Monitor *m) {
m->visible_clients == 1 && no_border_when_single && smartgaps
? 0
: borderpx;
if (VISIBLEON(c, c->mon) && !c->isunglobal &&
if (VISIBLEON(c, m) && !c->isunglobal &&
(m->isoverview || ISTILED(c))) {
cw = (m->w.width - 2 * overviewgappo) * 0.7;
ch = (m->w.height - 2 * overviewgappo) * 0.8;
@ -173,7 +173,7 @@ void grid(Monitor *m) {
m->visible_clients == 1 && no_border_when_single && smartgaps
? 0
: borderpx;
if (VISIBLEON(c, c->mon) && !c->isunglobal &&
if (VISIBLEON(c, m) && !c->isunglobal &&
(m->isoverview || ISTILED(c))) {
if (i == 0) {
c->geom.x = m->w.x + overviewgappo;
@ -219,7 +219,7 @@ void grid(Monitor *m) {
c->bw = m->visible_clients == 1 && no_border_when_single && smartgaps
? 0
: borderpx;
if (VISIBLEON(c, c->mon) && !c->isunglobal &&
if (VISIBLEON(c, m) && !c->isunglobal &&
(m->isoverview || ISTILED(c))) {
cx = m->w.x + (i % cols) * (cw + overviewgappi);
cy = m->w.y + (i / cols) * (ch + overviewgappi);
@ -317,7 +317,7 @@ void scroller(Monitor *m) {
// 第一次遍历,计算 n 的值
wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, c->mon) && ISTILED(c)) {
if (VISIBLEON(c, m) && ISTILED(c)) {
n++;
}
}
@ -336,7 +336,7 @@ void scroller(Monitor *m) {
// 第二次遍历,填充 tempClients
n = 0;
wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, c->mon) && ISTILED(c)) {
if (VISIBLEON(c, m) && ISTILED(c)) {
tempClients[n] = c;
n++;
}