summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-02-23 15:10:21 -0500
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-02-23 15:10:21 -0500
commit68af85deb132f9b32685843cf8968c77a7a3d5a8 (patch)
tree04bb58c1fab37c66117f55ab6dc4d3cea94c3f95
parentbafc958a9210a15ff5d206491f9fd634201ce7b8 (diff)
downloadscreen-68af85deb132f9b32685843cf8968c77a7a3d5a8.tar.gz
Add the navigation support back in the window list.
Pressing 'm' toggles the MRU-ness, pressing 'a' shows the list of all windows. Still left to do: deal with nested view.
-rw-r--r--src/list_window.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/list_window.c b/src/list_window.c
index 2313cbf..d946fe1 100644
--- a/src/list_window.c
+++ b/src/list_window.c
@@ -227,10 +227,61 @@ gl_Window_input(struct ListData *ldata, char **inp, int *len)
glist_abort();
display = cd;
}
- SwitchWindow(win->w_number);
+ if (D_fore != win)
+ SwitchWindow(win->w_number);
*len = 0;
break;
+ case 'm':
+ /* Toggle MRU-ness */
+ wdata->order = wdata->order == WLIST_MRU ? WLIST_NUM : WLIST_MRU;
+ glist_remove_rows(ldata);
+ gl_Window_rebuild(ldata);
+ break;
+
+ case 'a':
+ /* All-window view */
+ if (wdata->group)
+ {
+ int order = wdata->order | (wdata->nested ? WLIST_NESTED : 0);
+ glist_abort();
+ display = cd;
+ display_windows(1, order, NULL);
+ *len = 0;
+ }
+ else if (!wdata->nested)
+ {
+ wdata->nested = 1;
+ glist_remove_rows(ldata);
+ gl_Window_rebuild(ldata);
+ }
+ break;
+
+ case 010: /* ^H */
+ case 0177: /* Backspace */
+ if (!wdata->group)
+ break;
+ if (wdata->group->w_group)
+ {
+ /* The parent is another group window. So switch to that window. */
+ struct win *g = wdata->group->w_group;
+ glist_abort();
+ display = cd;
+ SetForeWindow(g);
+ *len = 0;
+ }
+ else
+ {
+ /* We were in a group view. Now we are moving to an all-window view.
+ * So treat it as 'windowlist on blank'. */
+ int order = wdata->order | (wdata->nested ? WLIST_NESTED : 0);
+ glist_abort();
+ display = cd;
+ display_windows(1, order, NULL);
+ *len = 0;
+ }
+ break;
+
case 033: /* escape */
case 007: /* ^G */
if (wdata->group)