Skip to content

Commit

Permalink
perf ui: Consider the refreshed dimensions in ui_browser__show
Browse files Browse the repository at this point in the history
When we call ui_browser__show we may have called
ui_browser__refresh_dimensions to check if the maximum lenght for the
contained entries changed, such as when zooming in and out DSOs or
threads in the hist browser.

For that to happen we must delete the old form, that will take care of
deleting the vertical scrollbar, etc, and then recreate them, with the
new dimensions.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jul 27, 2010
1 parent 06daaab commit 63160f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/perf/util/newt.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ static void ui_browser__reset_index(struct ui_browser *self)

static int ui_browser__show(struct ui_browser *self, const char *title)
{
if (self->form != NULL)
return 0;
if (self->form != NULL) {
newtFormDestroy(self->form);
newtPopWindow();
}
ui_browser__refresh_dimensions(self);
newtCenteredWindow(self->width + 2, self->height, title);
self->form = newt_form__new();
Expand Down

0 comments on commit 63160f7

Please sign in to comment.