Browse Source

Check if tag exist in mouse_drag_tag after getting ptr

Martin Duquesnoy 12 years ago
parent
commit
03a48e4381
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/mouse.c

+ 7 - 2
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;
 }