Fix some free client issues, add double fork in spawn
This commit is contained in:
parent
4deb60dfa6
commit
2ac4d8ffd0
27
src/client.c
27
src/client.c
@ -493,7 +493,7 @@ _client_tab(struct client *c, struct client *cm)
|
||||
{
|
||||
long m[2] = { CLIENT_TILED, CLIENT_FREE };
|
||||
|
||||
/* Do not tab already tabed client */
|
||||
/* Do not tab already tabbed client */
|
||||
if(c->flags & (CLIENT_TABBED | CLIENT_TABMASTER)
|
||||
|| c->tag != cm->tag || c == cm)
|
||||
return;
|
||||
@ -841,18 +841,25 @@ client_apply_rule(struct client *c)
|
||||
|
||||
if(flags & (RINSTANCE | RCLASS | RNAME) && flags & RROLE)
|
||||
{
|
||||
if(r->screen > 0)
|
||||
c->screen = screen_gb_id(r->screen);
|
||||
|
||||
c->tag = c->screen->seltag;
|
||||
if(r->tag > 0)
|
||||
c->tag = tag_gb_id(c->screen, r->tag);
|
||||
|
||||
c->theme = r->theme;
|
||||
|
||||
if(r->flags & RULE_FREE)
|
||||
c->flags |= CLIENT_FREE;
|
||||
FLAGAPPLY(c->flags, (r->flags & RULE_FREE), CLIENT_FREE);
|
||||
|
||||
|
||||
/* TODO
|
||||
if(r->flags & RULE_MAX)
|
||||
{ /* TODO */ }
|
||||
{}
|
||||
|
||||
if(r->flags & RULE_IGNORE_TAG)
|
||||
{ /* TODO */ }
|
||||
{}
|
||||
*/
|
||||
|
||||
c->flags |= CLIENT_RULED;
|
||||
}
|
||||
@ -1055,8 +1062,6 @@ client_moveresize(struct client *c, struct geo *g)
|
||||
c->wgeo.y = c->tbarw;
|
||||
c->geo.w = c->rgeo.w = c->wgeo.w + c->border + c->border;
|
||||
c->geo.h = c->rgeo.h = c->wgeo.h + c->tbarw + c->border;
|
||||
|
||||
c->fgeo = c->geo;
|
||||
}
|
||||
/* Adjust window regarding required size for frame (tiling) */
|
||||
else
|
||||
@ -1067,6 +1072,8 @@ client_moveresize(struct client *c, struct geo *g)
|
||||
client_winsize(c, g);
|
||||
}
|
||||
|
||||
c->fgeo = c->geo;
|
||||
|
||||
/* Real geo regarding full root size */
|
||||
c->rgeo.x += c->screen->ugeo.x;
|
||||
c->rgeo.y += c->screen->ugeo.y;
|
||||
@ -1361,15 +1368,15 @@ uicb_client_toggle_free(Uicb cmd)
|
||||
|
||||
W->client->flags ^= CLIENT_FREE;
|
||||
|
||||
layout_client(W->client);
|
||||
|
||||
/* Set tabbed client of toggled client as free */
|
||||
if(W->client->flags & CLIENT_TABMASTER)
|
||||
{
|
||||
SLIST_FOREACH(c, &W->client->tag->clients, tnext)
|
||||
if(c->tabmaster == W->client)
|
||||
if(c->tabmaster == W->client && c != W->client)
|
||||
c->flags ^= CLIENT_FREE;
|
||||
}
|
||||
|
||||
layout_client(W->client);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@ -375,7 +375,7 @@ layout_split_integrate(struct client *c, struct client *sc)
|
||||
*/
|
||||
FOREACH_NFCLIENT(sc, &c->tag->clients, tnext)
|
||||
{
|
||||
if(!(sc->flags & CLIENT_TILED) || sc == c)
|
||||
if(sc == c || sc->flags & CLIENT_TABBED)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
@ -567,8 +567,8 @@ layout_client(struct client *c)
|
||||
|
||||
if(c->flags & CLIENT_FREE)
|
||||
{
|
||||
c->flags &= ~CLIENT_TILED;
|
||||
layout_split_arrange_closed(c);
|
||||
c->flags ^= CLIENT_TILED;
|
||||
client_moveresize(c, &c->fgeo);
|
||||
XRaiseWindow(W->dpy, c->frame);
|
||||
}
|
||||
|
||||
@ -108,6 +108,8 @@ spawn(const char *format, ...)
|
||||
if(!(sh = getenv("SHELL")) || sh[0] != '/')
|
||||
sh = "/bin/sh";
|
||||
|
||||
if((pid = fork()) == 0)
|
||||
{
|
||||
if((pid = fork()) == 0)
|
||||
{
|
||||
setsid();
|
||||
@ -115,6 +117,8 @@ spawn(const char *format, ...)
|
||||
warnl("execl(sh -c %s)", cmd);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
else if (pid == -1)
|
||||
warnl("fork");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user