From 3d450c3d20504c50109a3d5e1b2cd3fec54d003b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Anger?= Date: Fri, 13 Apr 2012 21:21:40 +0200 Subject: [PATCH] fix client moving --- src/tag.c | 24 ++++++++---------------- src/wmfs.h | 2 +- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/tag.c b/src/tag.c index 4a2e968..6717ba7 100644 --- a/src/tag.c +++ b/src/tag.c @@ -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) diff --git a/src/wmfs.h b/src/wmfs.h index aec91ae..0a79fc7 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -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 */