From 99db61ed7c4b0971b2bdb535a16185786bf1809e Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 16 Jun 2026 13:30:52 +0800 Subject: [PATCH 1/3] fix: dwindle refuse arrange when restore from tty in non-selmon dwindle relies on sel window cutting, but the sel window has been cleared when the display is destroyed and was not set when the display is created --- src/layout/dwindle.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layout/dwindle.h b/src/layout/dwindle.h index 74e79477..9562b5d8 100644 --- a/src/layout/dwindle.h +++ b/src/layout/dwindle.h @@ -565,6 +565,7 @@ void dwindle(Monitor *m) { break; } + // 清理树中已不存在的客户端 { DwindleNode *leaves[512]; int32_t lc = 0; @@ -602,9 +603,14 @@ void dwindle(Monitor *m) { } } + // 获得焦点客户端,若为空则用第一个可见平铺客户端兜底 Client *focused = focustop(m); if (focused && !dwindle_find_leaf(*root, focused)) focused = m->sel; + + if (!focused && count > 0) + focused = vis[0]; + for (int32_t i = 0; i < count; i++) { if (!dwindle_find_leaf(*root, vis[i])) dwindle_insert_with_config(root, vis[i], focused, ratio); From b92ff0ec785f733982c36e164ba1dcf2416dba92 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 16 Jun 2026 13:40:32 +0800 Subject: [PATCH 2/3] opt: ensure sel client exist in all monitor --- src/layout/arrange.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/layout/arrange.h b/src/layout/arrange.h index 23b9d080..f1c97f3a 100644 --- a/src/layout/arrange.h +++ b/src/layout/arrange.h @@ -1223,6 +1223,10 @@ arrange(Monitor *m, bool want_animation, bool from_view) { if (!m->wlr_output->enabled) return; + if (!m->sel) { + m->sel = focustop(m); + } + pre_caculate_before_arrange(m, want_animation, from_view, false); if (m->isoverview) { From 055607383acf2957776b933c3784d4b609987d70 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 16 Jun 2026 14:37:58 +0800 Subject: [PATCH 3/3] bump version to 0.14.4 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 9da040f0..c68b5b13 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('mango', ['c'], - version : '0.14.3', + version : '0.14.4', ) subdir('protocols')