fix: fix center tile size per reset

This commit is contained in:
DreamMaoMao 2026-02-14 08:35:30 +08:00
parent ef92029ae0
commit d8b8d71fed

View file

@ -11,13 +11,16 @@ void restore_size_per(Monitor *m, Client *c) {
if (current_layout->id == SCROLLER ||
current_layout->id == VERTICAL_SCROLLER || current_layout->id == GRID ||
current_layout->id == VERTICAL_GRID || current_layout->id == DECK ||
current_layout->id == VERTICAL_DECK ||
current_layout->id == CENTER_TILE || current_layout->id == MONOCLE) {
current_layout->id == VERTICAL_DECK || current_layout->id == MONOCLE) {
return;
}
if (current_layout->id == CENTER_TILE || c->ismaster) {
set_size_per(m, c);
wl_list_for_each(fc, &clients, link) {
if (VISIBLEON(fc, m) && ISTILED(fc) && !c->ismaster) {
set_size_per(m, fc);
}
}
return;
}
@ -44,8 +47,13 @@ void set_size_per(Monitor *m, Client *c) {
if (!m || !c)
return;
const Layout *current_layout = m->pertag->ltidxs[m->pertag->curtag];
wl_list_for_each(fc, &clients, link) {
if (VISIBLEON(fc, m) && ISTILED(fc) && fc != c) {
if (current_layout->id == CENTER_TILE &&
!(fc->isleftstack ^ c->isleftstack))
continue;
c->master_mfact_per = fc->master_mfact_per;
c->master_inner_per = fc->master_inner_per;
c->stack_inner_per = fc->stack_inner_per;