Check if tag exist in mouse_drag_tag after getting ptr

This commit is contained in:
Martin Duquesnoy 2012-01-17 21:42:21 +01:00
parent 717fa182d4
commit 03a48e4381

View File

@ -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;
}