Fix tag mapping at reload
This commit is contained in:
parent
f7a7b60606
commit
be41fa5de8
@ -391,7 +391,7 @@ client_frame_update(struct client *c, struct colpair *cp)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
client_tab_focus(struct client *c)
|
||||
{
|
||||
if(c->flags & CLIENT_TABBED && c->tabmaster)
|
||||
@ -472,7 +472,6 @@ client_untab(struct client *c)
|
||||
|
||||
if(!(c->flags & CLIENT_DYING))
|
||||
{
|
||||
|
||||
/* Looking for tabbed client in cc, if there is not
|
||||
* remove cc CLIENT_TABMASTER flag.
|
||||
*/
|
||||
@ -833,7 +832,7 @@ client_new(Window w, XWindowAttributes *wa, bool scan)
|
||||
if(!scan)
|
||||
tag_client((c->flags & CLIENT_RULED ? c->tag : c->screen->seltag), c);
|
||||
|
||||
/* Map */
|
||||
/* Map, not at reload */
|
||||
if(c->tag == c->screen->seltag)
|
||||
client_map(c);
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ void client_swap(struct client *c, enum position p);
|
||||
void client_frame_update(struct client *c, struct colpair *cp);
|
||||
void client_tab_pull(struct client *c);
|
||||
void _client_tab(struct client *c, struct client *cm);
|
||||
void client_tab_focus(struct client *c);
|
||||
void client_focus(struct client *c);
|
||||
void client_get_name(struct client *c);
|
||||
void client_close(struct client *c);
|
||||
|
||||
@ -122,7 +122,7 @@ tag_client(struct tag *t, struct client *c)
|
||||
tag_client(t, cc);
|
||||
}
|
||||
|
||||
if(t != W->screen->seltag)
|
||||
if(t != W->screen->seltag || c->flags & CLIENT_TABBED)
|
||||
client_unmap(c);
|
||||
}
|
||||
|
||||
|
||||
35
src/wmfs.c
35
src/wmfs.c
@ -195,6 +195,23 @@ wmfs_scan(void)
|
||||
|
||||
SLIST_INIT(&W->h.client);
|
||||
|
||||
/* Set back selected tag */
|
||||
if(XGetWindowProperty(W->dpy, W->root, W->net_atom[wmfs_current_tag], 0, 32,
|
||||
False, XA_CARDINAL, &rt, &rf, &ir, &il,
|
||||
(unsigned char**)&ret)
|
||||
== Success && ret)
|
||||
{
|
||||
struct screen *s;
|
||||
|
||||
for(i = 0; i < (int)ir; ++i)
|
||||
{
|
||||
s = screen_gb_id(i);
|
||||
tag_screen(s, tag_gb_id(s, ret[i]));
|
||||
}
|
||||
|
||||
XFree(ret);
|
||||
}
|
||||
|
||||
if(XQueryTree(W->dpy, W->root, &usl, &usl2, &w, (unsigned int*)&n))
|
||||
for(i = n - 1; i != -1; --i)
|
||||
{
|
||||
@ -265,6 +282,7 @@ wmfs_scan(void)
|
||||
{
|
||||
c->screen = screen_gb_id(screen);
|
||||
c->flags |= CLIENT_IGNORE_LAYOUT;
|
||||
client_map(c);
|
||||
tag_client(tag_gb_id(c->screen, tag), c);
|
||||
client_moveresize(c, &g);
|
||||
client_get_name(c);
|
||||
@ -275,25 +293,10 @@ wmfs_scan(void)
|
||||
/* Re-adjust tabbed clients */
|
||||
SLIST_FOREACH(c, &W->h.client, next)
|
||||
if((cc = client_gb_win(c->tmp)) && cc != c)
|
||||
_client_tab(c, cc);
|
||||
|
||||
/* Set back selected tag */
|
||||
if(XGetWindowProperty(W->dpy, W->root, W->net_atom[wmfs_current_tag], 0, 32,
|
||||
False, XA_CARDINAL, &rt, &rf, &ir, &il,
|
||||
(unsigned char**)&ret)
|
||||
== Success && ret)
|
||||
{
|
||||
struct screen *s;
|
||||
|
||||
for(i = 0; i < (int)ir; ++i)
|
||||
{
|
||||
s = screen_gb_id(i);
|
||||
tag_screen(s, tag_gb_id(s, ret[i]));
|
||||
_client_tab(c, cc);
|
||||
}
|
||||
|
||||
XFree(ret);
|
||||
}
|
||||
|
||||
XFree(w);
|
||||
}
|
||||
|
||||
|
||||
@ -169,7 +169,6 @@ struct client
|
||||
Window win, frame, tmp;
|
||||
SLIST_ENTRY(client) next; /* Global list */
|
||||
SLIST_ENTRY(client) tnext; /* struct tag list */
|
||||
SLIST_ENTRY(client) tbnext; /* Tabbed client list */
|
||||
};
|
||||
|
||||
struct layout_set
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user