From 03a48e4381481169fabfead898b951530309e2d8 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Tue, 17 Jan 2012 21:42:21 +0100 Subject: [PATCH] Check if tag exist in mouse_drag_tag after getting ptr --- src/mouse.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index 33037c0..a862f82 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -73,7 +73,7 @@ static struct tag* mouse_drag_tag(struct client *c, Window w) { struct barwin *b; - struct tag *t; + struct tag *t, *tt; Window rw; int d, u; @@ -83,7 +83,12 @@ mouse_drag_tag(struct client *c, Window w) if(b->win == rw && (t = (struct tag*)b->ptr) && t != c->tag) - return t; + { + /* Check if tag exist */ + TAILQ_FOREACH(tt, &c->screen->tags, next) + if(tt == t) + return t; + } return NULL; }