fix: should use floating window as next prev client

This commit is contained in:
DreamMaoMao 2025-10-10 12:18:30 +08:00
parent b00d5ad4bc
commit 53a02b8be2

View file

@ -3892,20 +3892,26 @@ void resize_tile_client(Client *grabc, unsigned int time) {
double refresh_interval = 1000000.0 / grabc->mon->wlr_output->refresh; double refresh_interval = 1000000.0 / grabc->mon->wlr_output->refresh;
wlr_log(WLR_ERROR, "%f", refresh_interval); wlr_log(WLR_ERROR, "%f", refresh_interval);
// 查找 grabc 在链表中的前一个和后一个客户端 // 查找 grabc 在链表中的前一个和后一个客户端
wl_list_for_each(tc, &clients, link) {
if (tc == grabc) { struct wl_list *node;
// 找到当前客户端,下一个节点就是 next
if (tc->link.next != &clients) { // 从当前节点的下一个开始遍历
next = wl_container_of(tc->link.next, next, link); for (node = grabc->link.next; node != &clients; node = node->next) {
} tc = wl_container_of(node, tc, link);
// 前一个节点就是 prev if (!tc->isfloating) { // 根据你的实际字段名调整
if (tc->link.prev != &clients) { next = tc;
prev = wl_container_of(tc->link.prev, prev, link);
}
break; break;
} }
} }
// 从当前节点的上一个开始遍历
for (node = grabc->link.prev; node != &clients; node = node->prev) {
tc = wl_container_of(node, tc, link);
if (!tc->isfloating) { // 根据你的实际字段名调整
prev = tc;
break;
}
}
if (!start_drag_window) { if (!start_drag_window) {
begin_cursorx = cursor->x; begin_cursorx = cursor->x;
begin_cursory = cursor->y; begin_cursory = cursor->y;