From: Julien Desfossez Date: Tue, 10 Apr 2012 21:09:31 +0000 (-0400) Subject: allow return to previous view with enter X-Git-Tag: v0.2~39 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=041aa219c7483da2cb59ea331941e00963d49ec7;p=lttngtop.git allow return to previous view with enter Signed-off-by: Julien Desfossez --- diff --git a/src/cursesdisplay.c b/src/cursesdisplay.c index 3d8d4e4..7dfe7ad 100644 --- a/src/cursesdisplay.c +++ b/src/cursesdisplay.c @@ -904,8 +904,12 @@ void *handle_keyboard(void *p) break; case 13: /* FIXME : KEY_ENTER ?? */ - if (current_view == cpu) { + if (current_view != process_details) { + previous_view = current_view; current_view = process_details; + } else { + current_view = previous_view; + previous_view = process_details; } update_current_view(); break; diff --git a/src/cursesdisplay.h b/src/cursesdisplay.h index 38e1996..9188659 100644 --- a/src/cursesdisplay.h +++ b/src/cursesdisplay.h @@ -22,14 +22,17 @@ #include #include "common.h" -enum current_view_list +enum view_list { cpu = 1, perf, process_details, iostream, tree, -} current_view; +}; + +enum view_list current_view; +enum view_list previous_view; void display(unsigned int); void init_ncurses();