summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-03-04 21:40:37 -0500
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-03-04 21:40:37 -0500
commit2e62d3683eefb23e6955b55c16ce3266b12aa401 (patch)
tree399136838e0e636d12a12360107813bd166a4df9
parent02328ed6c832ce36dd3843c1bf2a99f007e7c2cb (diff)
downloadscreen-2e62d3683eefb23e6955b55c16ce3266b12aa401.tar.gz
Some more fixes for the window list.
Detecting when to destroy a window-list is rather complicated.
-rw-r--r--src/list_window.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/list_window.c b/src/list_window.c
index 21ca837..c46aa9e 100644
--- a/src/list_window.c
+++ b/src/list_window.c
@@ -58,6 +58,9 @@ struct gl_Window_Data
struct win *fore; /* The foreground window we had. */
};
+/* Is this wdata for a group window? */
+#define WLIST_FOR_GROUP(wdate) ((wdata)->group && !(wdata)->onblank && Layer2Window(flayer) && Layer2Window(flayer)->w_type == W_TYPE_GROUP)
+
/* This macro should not be used if 'fn' is expected to update the window list */
#define FOR_EACH_WINDOW(_wdata, _w, fn) do { \
if ((_wdata)->order == WLIST_MRU) \
@@ -300,14 +303,16 @@ gl_Window_input(struct ListData *ldata, char **inp, int *len)
if (display && AclCheckPermWin(D_user, ACL_READ, win))
return; /* Not allowed to switch to this window. */
#endif
- if (wdata->onblank || (!wdata->onblank && wdata->group))
+ if (WLIST_FOR_GROUP(wdata))
+ SwitchWindow(win->w_number);
+ else
{
- /* Do not abort the group window. */
+ /* Abort list only when not in a group window. */
glist_abort();
display = cd;
+ if (D_fore != win)
+ SwitchWindow(win->w_number);
}
- if (D_fore != win)
- SwitchWindow(win->w_number);
*len = 0;
break;
@@ -406,7 +411,7 @@ gl_Window_input(struct ListData *ldata, char **inp, int *len)
case 033: /* escape */
case 007: /* ^G */
- if (wdata->onblank || (!wdata->onblank && wdata->group))
+ if (!WLIST_FOR_GROUP(wdata))
{
int fnumber = wdata->fore->w_number;
glist_abort();
@@ -414,9 +419,8 @@ gl_Window_input(struct ListData *ldata, char **inp, int *len)
if (wdata->onblank)
SwitchWindow(fnumber);
*len = 0;
- break;
}
- /* else FALLTHROUGH */
+ break;
default:
--*inp;
++*len;