Skip to contentSkip to conversation

perf ui: Consider the refreshed dimensions in ui_browser__show

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Aug 2, 2010 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  63160f73e7baa6618f19d7681bcab5be5c557205
Gitweb:     http://git.kernel.org/tip/63160f73e7baa6618f19d7681bcab5be5c557205
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 26 Jul 2010 13:47:15 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 27 Jul 2010 11:24:31 -0300

perf ui: Consider the refreshed dimensions in ui_browser__show

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 <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/util/newt.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
tools/perf/util/newt.c +4 -2
index 2f5f7a1..aed2149 100644
@@ -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();