From 67259641defce5b6715bfadae616f99b75fa41a2 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 14 May 2025 20:55:05 +0800 Subject: [PATCH] opt: optimzie drag_tile_to_tile logic --- src/maomao.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/maomao.c b/src/maomao.c index 86becfe..9a27353 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -2556,12 +2556,14 @@ void place_drag_tile_client(Client *c) { } } } - if(closest_client) { + if(closest_client && closest_client->link.prev != &c->link) { wl_list_remove(&c->link); c->link.next = &closest_client->link; c->link.prev = closest_client->link.prev; closest_client->link.prev->next = &c->link; closest_client->link.prev = &c->link; + } else if(closest_client) { + exchange_two_client(c, closest_client); } setfloating(c, 0); }