Select first tag of each screen if !tag prop at start/reload
This commit is contained in:
parent
4a11107d67
commit
3d44ce225a
12
src/client.h
12
src/client.h
@ -132,4 +132,16 @@ clients_arrange_map(void)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
clients_tag_arrange_map(struct tag *t)
|
||||
{
|
||||
struct client *c;
|
||||
void (*sfunc)(struct client*)
|
||||
= (t == t->screen->seltag ? client_map : client_unmap);
|
||||
|
||||
SLIST_FOREACH(c, &t->clients, tnext)
|
||||
sfunc(c);
|
||||
}
|
||||
|
||||
|
||||
#endif /* CLIENT_H */
|
||||
|
||||
@ -107,7 +107,7 @@ tag_client(struct tag *t, struct client *c)
|
||||
tag_client(t, cc);
|
||||
}
|
||||
|
||||
if(t != W->screen->seltag || c->flags & CLIENT_TABBED)
|
||||
if(t != c->screen->seltag || c->flags & CLIENT_TABBED)
|
||||
client_unmap(c);
|
||||
}
|
||||
|
||||
|
||||
23
src/wmfs.c
23
src/wmfs.c
@ -186,7 +186,7 @@ wmfs_scan(void)
|
||||
struct geo g;
|
||||
struct client *c, *cc, *fc;
|
||||
struct screen *s;
|
||||
int i, n, rf, nscreen;
|
||||
int i, n, rf, nscreen = 0;
|
||||
int tag = -1, screen = -1, flags = -1;
|
||||
unsigned long ir, il;
|
||||
long *ret, *tret;
|
||||
@ -205,7 +205,6 @@ wmfs_scan(void)
|
||||
(unsigned char**)&tret)
|
||||
== Success && ret)
|
||||
{
|
||||
pstag = true;
|
||||
nscreen = (int)ir;
|
||||
}
|
||||
|
||||
@ -298,20 +297,19 @@ wmfs_scan(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Set back selected tag */
|
||||
if(pstag)
|
||||
if(!nscreen)
|
||||
{
|
||||
struct tag *t;
|
||||
|
||||
SLIST_FOREACH(s, &W->h.screen, next)
|
||||
tag_screen(s, TAILQ_FIRST(&s->tags));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set back selected tag */
|
||||
for(i = 0; i < nscreen; ++i)
|
||||
{
|
||||
s = screen_gb_id(i);
|
||||
|
||||
if((t = tag_gb_id(s, tret[i])) != s->seltag)
|
||||
tag_screen(s, t);
|
||||
tag_screen(s, tag_gb_id(s, tret[i]));
|
||||
}
|
||||
|
||||
XFree(tret);
|
||||
}
|
||||
|
||||
/* Re-adjust tabbed clients */
|
||||
@ -324,6 +322,9 @@ wmfs_scan(void)
|
||||
|
||||
W->flags &= ~WMFS_SCAN;
|
||||
|
||||
if(tret)
|
||||
XFree(tret);
|
||||
|
||||
XFree(w);
|
||||
XSync(W->dpy, false);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user