Fix possible W->client = NULL in generated client funcs
This commit is contained in:
parent
68aecac27c
commit
07014979c1
@ -22,20 +22,22 @@ void uicb_client_resize_##D(Uicb cmd) \
|
||||
client_fac_resize(W->client, D, ATOI(cmd)); \
|
||||
}
|
||||
|
||||
#define CLIENT_ACTION_DIR(A, D) \
|
||||
void uicb_client_##A##_##D(Uicb cmd) \
|
||||
{ \
|
||||
(void)cmd; \
|
||||
if(W->client) \
|
||||
client_##A(client_next_with_pos(W->client, D)); \
|
||||
#define CLIENT_ACTION_DIR(A, D) \
|
||||
void uicb_client_##A##_##D(Uicb cmd) \
|
||||
{ \
|
||||
(void)cmd; \
|
||||
struct client *c; \
|
||||
if(W->client && (c = client_next_with_pos(W->client, D))) \
|
||||
client_##A(c); \
|
||||
}
|
||||
|
||||
#define CLIENT_ACTION_LIST(A, L) \
|
||||
void uicb_client_##A##_##L(Uicb cmd) \
|
||||
{ \
|
||||
(void)cmd; \
|
||||
if(W->client) \
|
||||
client_##A(client_##L(W->client)); \
|
||||
#define CLIENT_ACTION_LIST(A, L) \
|
||||
void uicb_client_##A##_##L(Uicb cmd) \
|
||||
{ \
|
||||
(void)cmd; \
|
||||
struct client *c; \
|
||||
if(W->client && (c = client_##L(W->client))) \
|
||||
client_##A(c); \
|
||||
}
|
||||
|
||||
/* uicb_client_resize_dir() */
|
||||
@ -122,7 +124,7 @@ client_next_with_pos(struct client *bc, Position p)
|
||||
{
|
||||
struct client *c;
|
||||
int x, y;
|
||||
const static char scanfac[PositionLast] = { +10, -10, 0, 0 };
|
||||
const static char scanfac[PositionLast] = { +1, -1, 0, 0 };
|
||||
|
||||
/*
|
||||
* Set start place of pointer (edge with position
|
||||
@ -421,7 +423,6 @@ client_remove(struct client *c)
|
||||
XSetErrorHandler(wmfs_error_handler);
|
||||
|
||||
free(c);
|
||||
c = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@ -54,10 +54,11 @@ client_next(struct client *c)
|
||||
static inline struct client*
|
||||
client_prev(struct client *c)
|
||||
{
|
||||
struct client *nc, *cc = SLIST_FIRST(&c->tag->clients);
|
||||
struct client *cc;
|
||||
|
||||
while((nc = SLIST_NEXT(cc, tnext)) && nc != c)
|
||||
cc = nc;
|
||||
for(cc = SLIST_FIRST(&c->tag->clients);
|
||||
SLIST_NEXT(cc, tnext) && SLIST_NEXT(cc, tnext) != c;
|
||||
cc = SLIST_NEXT(cc, tnext));
|
||||
|
||||
return cc;
|
||||
}
|
||||
|
||||
@ -91,10 +91,10 @@ tag_client(struct tag *t, struct client *c)
|
||||
|
||||
layout_split_arrange_closed(c);
|
||||
|
||||
SLIST_REMOVE(&c->tag->clients, c, client, tnext);
|
||||
|
||||
if(c->tag->sel == c || W->client == c)
|
||||
client_focus(client_next(c));
|
||||
|
||||
SLIST_REMOVE(&c->tag->clients, c, client, tnext);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user