fix client moving

This commit is contained in:
Jérémy Anger 2012-04-13 21:21:40 +02:00
parent 0085dd16e3
commit 3d450c3d20
2 changed files with 9 additions and 17 deletions

View File

@ -48,33 +48,24 @@ tag_screen(struct screen *s, struct tag *t)
{
struct client *c;
/* Return to the previous tag */
if(t == s->seltag && TAILQ_NEXT(TAILQ_FIRST(&s->tags), next))
t = t->prev;
if(!t)
t = TAILQ_FIRST(&s->tags);
/* Move clients which ignore tags */
SLIST_FOREACH(c, &W->h.client, next)
if (c->flags & CLIENT_IGNORE_TAG)
tag_client(t, c);
t->prev = s->seltag;
s->seltag = t;
/* Move clients if they ignore tags */
SLIST_FOREACH(c, &W->h.client, next)
if (c->flags & CLIENT_IGNORE_TAG && c->screen == s)
tag_client(s->seltag, c);
clients_arrange_map();
/* Update focus */
if (t->sel == NULL)
{
SLIST_FOREACH(c, &W->h.client, next)
if (c->tag == t)
{
client_focus(c);
break;
}
}
if(!SLIST_EMPTY(&t->clients) && !(W->flags & WMFS_SCAN))
client_focus( client_tab_next(t->sel));
@ -107,7 +98,8 @@ tag_client(struct tag *t, struct client *c)
}
}
c->flags &= ~CLIENT_RULED;
if (!(c->flags & CLIENT_IGNORE_TAG))
c->flags &= ~CLIENT_RULED;
/* Client remove */
if(!t)

View File

@ -216,7 +216,7 @@ struct client
#define CLIENT_FREE 0x1000
#define CLIENT_TILED 0x2000
#define CLIENT_MOUSE 0x4000
#define CLIENT_IGNORE_TAG 0x8000
#define CLIENT_IGNORE_TAG 0x8000
Flags flags;
Window win, frame, tmp;
SLIST_ENTRY(client) next; /* Global list */