opt: re caculate maxmizescreen window size in arrange

This commit is contained in:
DreamMaoMao 2025-04-29 11:32:58 +08:00
parent 43dd28d992
commit c72888d391

View file

@ -541,6 +541,7 @@ static void setcursor(struct wl_listener *listener, void *data);
static void setfloating(Client *c, int floating);
static void setfullscreen(Client *c, int fullscreen);
static void setmaxmizescreen(Client *c, int maxmizescreen);
static void reset_maxmizescreen_size(Client *c);
static void setgaps(int oh, int ov, int ih, int iv);
static void setmon(Client *c, Monitor *m, unsigned int newtags, bool focus);
@ -1754,6 +1755,13 @@ arrange(Monitor *m, bool want_animation) {
}
}
}
if (c->mon == m && c->ismaxmizescreen
&& !c->animation.tagouted && !c->animation.tagouting && VISIBLEON(c, m)) {
reset_maxmizescreen_size(c);
}
}
// 给全屏窗口设置背景为黑色
@ -4994,6 +5002,15 @@ setfloating(Client *c, int floating) {
printstatus();
}
void reset_maxmizescreen_size(Client *c) {
c->geom.x = c->mon->w.x + gappov;
c->geom.y = c->mon->w.y + gappoh;
c->geom.width = c->mon->w.width - 2 * gappov;
c->geom.height = c->mon->w.height - 2 * gappov;
resize(c, c->geom, 0);
}
void setmaxmizescreen(Client *c, int maxmizescreen) {
struct wlr_box maxmizescreen_box;
if (!c || !c->mon || !client_surface(c)->mapped || c->iskilling)