From 378cb70acc00b86c0530d9f5ff2a21335b30dfbd Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Fri, 21 Aug 2009 17:56:36 +0200 Subject: [PATCH] Mouse: Securize client swapping / client tagging with mouse --- src/mouse.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index a0a0a9b..465a4d7 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -55,6 +55,7 @@ mouse_move(Client *c) int ocx, ocy, mx, my, i; int dint, oscreen = c->screen; uint duint; + Bool busy[2]; Window dw, sw; Client *sclient; XRectangle geo = c->geo; @@ -102,11 +103,12 @@ mouse_move(Client *c) || (sclient = client_gb_frame(sw)) || (sclient = client_gb_titlebar(sw))) { - if(c->win != sclient->win) + if(c->win != sclient->win && !busy[1]) { client_swap(sclient, c); client_focus(sclient); swap_ptr((void**)&c, (void**)&sclient); + busy[0] = True; } } @@ -115,7 +117,8 @@ mouse_move(Client *c) for(i = 1; i < conf.ntag[selscreen] + 1; ++i) if(infobar[selscreen].tags[i]->win == sw - && tags[selscreen][i].layout.func != freelayout) + && tags[selscreen][i].layout.func != freelayout + && !busy[0]) { c->screen = selscreen; c->tag = i; @@ -123,6 +126,7 @@ mouse_move(Client *c) arrange(oscreen, True); if(oscreen != c->screen) arrange(c->screen, True); + busy[1] = True; } }