Each view can access process details view
authorJulien Desfossez <julien.desfossez@efficios.com>
Tue, 10 Apr 2012 21:17:28 +0000 (17:17 -0400)
committerJulien Desfossez <julien.desfossez@efficios.com>
Tue, 10 Apr 2012 21:17:28 +0000 (17:17 -0400)
Every time the user switches to a different view, the blue line is reset
to the first line and he can use the enter key to enter in the process
details view (and reuse enter to switch back).

Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
src/cursesdisplay.c

index 7dfe7ad0937ac2164d530f8aed373573c0c6bfa9..c18d46cbf2d709936ea433371e3068ff9f541a28 100644 (file)
@@ -61,7 +61,6 @@ int max_elements = 80;
 
 int toggle_threads = -1;
 int toggle_pause = -1;
-int toggle_tree = -1;
 
 int max_center_lines;
 
@@ -530,6 +529,8 @@ void update_perf()
 
                if (current_line == selected_line) {
                        selected_process = tmp;
+                       selected_tid = tmp->tid;
+                       selected_comm = tmp->comm;
                        wattron(center, COLOR_PAIR(5));
                        mvwhline(center, current_line + header_offset, 1, ' ', COLS-3);
                }
@@ -915,22 +916,23 @@ void *handle_keyboard(void *p)
                        break;
 
                case KEY_F(1):
-                       toggle_tree *= -1;
                        current_view = cpu;
+                       selected_line = 0;
                        update_current_view();
                        break;
                case KEY_F(2):
                        current_view = cpu;
+                       selected_line = 0;
                        update_current_view();
                        break;
                case KEY_F(3):
                        current_view = perf;
-                       toggle_tree = -1;
+                       selected_line = 0;
                        update_current_view();
                        break;
                case KEY_F(4):
                        current_view = iostream;
-                       toggle_tree = -1;
+                       selected_line = 0;
                        update_current_view();
                        break;
                case KEY_F(10):
This page took 0.032709 seconds and 4 git commands to generate.