fix: ensure the global link own same order like scroller tag link

This commit is contained in:
DreamMaoMao 2026-05-12 22:26:00 +08:00
parent 30f00ba50a
commit a165d0b196

View file

@ -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);
}
}
}