fix: slave client should put in right when only one slave client

This commit is contained in:
DreamMaoMao 2025-09-27 18:03:19 +08:00
parent f90f575a4c
commit a0a0474ee1

View file

@ -474,11 +474,11 @@ void center_tile(Monitor *m) {
} else if (n - nmasters == 1) {
// 单个堆叠窗口的处理
if (center_when_single_slave) {
// 启用选项:主区域居中,堆叠窗口在左,右边空着
// 修改slave在右边master居中边空着
tw = (m->w.width - mw - 2 * gappoh - gappih) / 2;
mx = gappoh + tw + gappih;
mx = gappoh + tw + gappih; // master居中
} else {
// 修改:slave在右边master在左边
// slave在右边master在左边
tw = m->w.width - mw - 2 * gappoh - gappih;
mx = gappoh; // master在左边
}
@ -525,10 +525,10 @@ void center_tile(Monitor *m) {
int stack_x;
if (center_when_single_slave) {
// 启用选项:放在左侧
stack_x = m->w.x + gappoh;
// 修改放在右侧master居中时slave在右边
stack_x = m->w.x + mx + mw + gappih;
} else {
// 修改:放在右侧
// 放在右侧master在左边时slave在右边
stack_x = m->w.x + mx + mw + gappih;
}