perf ui: Make ui_browser__run exit on unhandled hot keys
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 15 Jul 2010 10:24:30 +0000 (07:24 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 17 Jul 2010 18:44:57 +0000 (15:44 -0300)
Right now ENTER doesn't always exits the newt tree widget, as it is used
for expanding/collapsing branches, but with the new tree widget being
developed we need to regain control to handle it, expanding/collapsing
branches.

In fact its really up to the ui_browser user to state what extra keys
should stop ui_browser__run, and it should handle just the ones needed
for basic browsing.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/newt.c

index 932f12468c3c78c73aa080ddd7adf79f348c83aa..7979003adeafb73599c4f4f069cffaf75daba369 100644 (file)
@@ -498,12 +498,8 @@ static int ui_browser__run(struct ui_browser *self, struct newtExitStruct *es)
                        self->first_visible_entry_idx = self->index - offset;
                        self->seek(self, -offset, SEEK_END);
                        break;
-               case NEWT_KEY_RIGHT:
-               case NEWT_KEY_LEFT:
-               case NEWT_KEY_TAB:
-                       return es->u.key;
                default:
-                       continue;
+                       return es->u.key;
                }
                if (ui_browser__refresh_entries(self) < 0)
                        return -1;