diff --git a/wmfs2/src/client.c b/wmfs2/src/client.c index 87c7cbd..049015d 100644 --- a/wmfs2/src/client.c +++ b/wmfs2/src/client.c @@ -89,25 +89,6 @@ client_configure(struct client *c) XSync(W->dpy, False); } -struct client* -client_next(struct client *c) -{ - struct client *next = SLIST_NEXT(c, tnext); - - return (next ? next : SLIST_FIRST(&c->tag->clients)); -} - -struct client* -client_prev(struct client *c) -{ - struct client *nc, *cc = SLIST_FIRST(&c->tag->clients); - - while((nc = SLIST_NEXT(cc, tnext)) && nc != c) - cc = nc; - - return cc; -} - struct client* client_gb_win(Window w) { diff --git a/wmfs2/src/client.h b/wmfs2/src/client.h index 3a295f9..91b2e8c 100644 --- a/wmfs2/src/client.h +++ b/wmfs2/src/client.h @@ -10,9 +10,6 @@ #include "layout.h" void client_configure(struct client *c); - -struct client *client_next(struct client *c); -struct client *client_prev(struct client *c); struct client *client_gb_win(Window w); struct client *client_gb_pos(struct tag *t, int x, int y); struct client *client_next_with_pos(struct client *bc, Position p); @@ -46,6 +43,25 @@ void uicb_client_focus_prev(Uicb); void uicb_client_swapsel_next(Uicb); void uicb_client_swapsel_prev(Uicb); +static inline struct client* +client_next(struct client *c) +{ + return (SLIST_NEXT(c, tnext) + ? SLIST_NEXT(c, tnext) + : SLIST_FIRST(&c->tag->clients)); +} + +static inline struct client* +client_prev(struct client *c) +{ + struct client *nc, *cc = SLIST_FIRST(&c->tag->clients); + + while((nc = SLIST_NEXT(cc, tnext)) && nc != c) + cc = nc; + + return cc; +} + static inline bool client_fac_geo(struct client *c, Position p, int fac) {