From e1ec0c29dfe275b1a8cf5a12e92077db8b5ab229 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Sat, 14 Mar 2009 14:31:18 +0100 Subject: [PATCH] Client: Fix client_swap. --- src/client.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/client.c b/src/client.c index e228136..ff72ec1 100644 --- a/src/client.c +++ b/src/client.c @@ -637,17 +637,22 @@ void client_swap(Client *a, Client *b) { Client *an, *bn, *ap, *bp; - int ts; + int i, ts, tt; + XRectangle tgeo; - if(!a || !b) + if(!a || !b || !a->tile || !b->tile) return; + /* Set temp variable */ ap = a->prev; an = a->next; bp = b->prev; bn = b->next; ts = a->screen; + tt = a->tag; + tgeo = a->geo; + /* Swap client in the double linked list */ if(a == b->next) { a->next = b; @@ -685,11 +690,15 @@ client_swap(Client *a, Client *b) else if(clients == b) clients = a; + /* Swap tag/screen property */ + a->tag = b->tag; + b->tag = tt; a->screen = b->screen; b->screen = ts; - arrange(a->screen); - arrange(b->screen); + /* Swap position/size an move them */ + client_moveresize(a, b->geo, False); + client_moveresize(b, tgeo, False); return; }