From a165d0b196ef726a7f1c98802b78eb347af3c343 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 12 May 2026 22:26:00 +0800 Subject: [PATCH] fix: ensure the global link own same order like scroller tag link --- src/layout/scroll.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/layout/scroll.h b/src/layout/scroll.h index e4a6d75f..0020a7b1 100644 --- a/src/layout/scroll.h +++ b/src/layout/scroll.h @@ -767,12 +767,16 @@ void scroller_insert_stack(Client *c, Client *target_client, if (tnode->prev_in_stack) tnode->prev_in_stack->next_in_stack = newnode; tnode->prev_in_stack = newnode; + wl_list_remove(&c->link); + wl_list_insert(tnode->client->link.prev, &c->link); } else { newnode->prev_in_stack = tnode; newnode->next_in_stack = tnode->next_in_stack; if (tnode->next_in_stack) tnode->next_in_stack->prev_in_stack = newnode; tnode->next_in_stack = newnode; + wl_list_remove(&c->link); + wl_list_insert(&tnode->client->link, &c->link); } /* 处理堆叠头部的全屏/最大化状态*/ @@ -817,7 +821,7 @@ void scroller_drop_tile(Client *c, Client *closest, int vertical) { } else if (closest->drop_direction == DOWN) { if (c != stack_tail) { wl_list_remove(&c->link); - wl_list_insert(&stack_head->link, &c->link); + wl_list_insert(&stack_tail->link, &c->link); } } } else { @@ -837,7 +841,7 @@ void scroller_drop_tile(Client *c, Client *closest, int vertical) { } else if (closest->drop_direction == RIGHT) { if (c != stack_tail) { wl_list_remove(&c->link); - wl_list_insert(&stack_head->link, &c->link); + wl_list_insert(&stack_tail->link, &c->link); } } }