fix client moving
This commit is contained in:
24
src/tag.c
24
src/tag.c
@@ -48,33 +48,24 @@ tag_screen(struct screen *s, struct tag *t)
|
|||||||
{
|
{
|
||||||
struct client *c;
|
struct client *c;
|
||||||
|
|
||||||
|
/* Return to the previous tag */
|
||||||
if(t == s->seltag && TAILQ_NEXT(TAILQ_FIRST(&s->tags), next))
|
if(t == s->seltag && TAILQ_NEXT(TAILQ_FIRST(&s->tags), next))
|
||||||
t = t->prev;
|
t = t->prev;
|
||||||
|
|
||||||
if(!t)
|
if(!t)
|
||||||
t = TAILQ_FIRST(&s->tags);
|
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;
|
t->prev = s->seltag;
|
||||||
s->seltag = t;
|
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();
|
clients_arrange_map();
|
||||||
|
|
||||||
/* Update focus */
|
/* 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))
|
if(!SLIST_EMPTY(&t->clients) && !(W->flags & WMFS_SCAN))
|
||||||
client_focus( client_tab_next(t->sel));
|
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 */
|
/* Client remove */
|
||||||
if(!t)
|
if(!t)
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ struct client
|
|||||||
#define CLIENT_FREE 0x1000
|
#define CLIENT_FREE 0x1000
|
||||||
#define CLIENT_TILED 0x2000
|
#define CLIENT_TILED 0x2000
|
||||||
#define CLIENT_MOUSE 0x4000
|
#define CLIENT_MOUSE 0x4000
|
||||||
#define CLIENT_IGNORE_TAG 0x8000
|
#define CLIENT_IGNORE_TAG 0x8000
|
||||||
Flags flags;
|
Flags flags;
|
||||||
Window win, frame, tmp;
|
Window win, frame, tmp;
|
||||||
SLIST_ENTRY(client) next; /* Global list */
|
SLIST_ENTRY(client) next; /* Global list */
|
||||||
|
|||||||
Reference in New Issue
Block a user