diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-11-16 10:10:26 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-11-16 10:10:26 +0000 |
commit | 46f5e42145ed34567b29c73032adbd8a41f5dfa2 (patch) | |
tree | c084d02f1886fb187d9c34977f45f59ea3d896ab /window.c | |
parent | 1425738790052e53211f8c38054f49eaf54cb644 (diff) | |
download | rtmux-46f5e42145ed34567b29c73032adbd8a41f5dfa2.tar.gz rtmux-46f5e42145ed34567b29c73032adbd8a41f5dfa2.tar.bz2 rtmux-46f5e42145ed34567b29c73032adbd8a41f5dfa2.zip |
Keep stack of previous windows.
Check for op (orig_pair) for default colours.
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.50 2008-09-26 06:45:28 nicm Exp $ */ +/* $Id: window.c,v 1.51 2008-11-16 10:10:26 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -164,6 +164,32 @@ winlink_previous(unused struct winlinks *wwl, struct winlink *wl) #endif } +void +winlink_stack_push(struct winlink_stack *stack, struct winlink *wl) +{ + if (wl == NULL) + return; + + winlink_stack_remove(stack, wl); + SLIST_INSERT_HEAD(stack, wl, sentry); +} + +void +winlink_stack_remove(struct winlink_stack *stack, struct winlink *wl) +{ + struct winlink *wl2; + + if (wl == NULL) + return; + + SLIST_FOREACH(wl2, stack, sentry) { + if (wl2 == wl) { + SLIST_REMOVE(stack, wl, winlink, sentry); + return; + } + } +} + struct window * window_create(const char *name, const char *cmd, const char **envp, u_int sx, u_int sy, u_int hlimit) |