From 31b676b639fff6fde494d8e017670934819eda5c Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 27 Sep 2025 12:12:13 +0800 Subject: [PATCH] opt: optimize center_tile layout slave client position --- src/layout/horizontal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index aca22e8..941f034 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -528,7 +528,8 @@ void center_tile(Monitor *m) { // 多个堆叠窗口:交替放在左右两侧 unsigned int r = (n - i + 1) / 2; - if (stack_index % 2) { + // 当n为奇数时翻转判断逻辑 + if ((stack_index % 2) ^ (n % 2 != 0)) { // 右侧堆叠窗口 h = (m->w.height - ety - gappov - gappiv * (r - 1)) / r; int stack_x = m->w.x + mx + mw + gappih;