mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-18 14:33:09 -04:00
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
This commit is contained in:
parent
512d09cda8
commit
99db61ed7c
1 changed files with 6 additions and 0 deletions
|
|
@ -565,6 +565,7 @@ void dwindle(Monitor *m) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清理树中已不存在的客户端
|
||||||
{
|
{
|
||||||
DwindleNode *leaves[512];
|
DwindleNode *leaves[512];
|
||||||
int32_t lc = 0;
|
int32_t lc = 0;
|
||||||
|
|
@ -602,9 +603,14 @@ void dwindle(Monitor *m) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得焦点客户端,若为空则用第一个可见平铺客户端兜底
|
||||||
Client *focused = focustop(m);
|
Client *focused = focustop(m);
|
||||||
if (focused && !dwindle_find_leaf(*root, focused))
|
if (focused && !dwindle_find_leaf(*root, focused))
|
||||||
focused = m->sel;
|
focused = m->sel;
|
||||||
|
|
||||||
|
if (!focused && count > 0)
|
||||||
|
focused = vis[0];
|
||||||
|
|
||||||
for (int32_t i = 0; i < count; i++) {
|
for (int32_t i = 0; i < count; i++) {
|
||||||
if (!dwindle_find_leaf(*root, vis[i]))
|
if (!dwindle_find_leaf(*root, vis[i]))
|
||||||
dwindle_insert_with_config(root, vis[i], focused, ratio);
|
dwindle_insert_with_config(root, vis[i], focused, ratio);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue