Keep stack of previous windows.

Check for op (orig_pair) for default colours.
This commit is contained in:
Nicholas Marriott
2008-11-16 10:10:26 +00:00
parent 1425738790
commit 46f5e42145
9 changed files with 72 additions and 23 deletions

View File

@ -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)