From d8ccfa3484e77baffbfe22d26357151000c62811 Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Thu, 29 Jul 2021 12:54:37 +0200 Subject: [PATCH] spdk_top: print first tab page after resizing There is a problem with data display after interface resize when user performs these actions: 1. Run spdk_top with multiple data pages 2. Switch to the last page 3. Enlarge interface increasing window height significantly. After following these steps user is presented with a blank tab with no records and incorrectly displayed page info (i.e. 3/1) and has to manually switch back to the pages containing selectable records. This patch forces spdk_top to display first data page after vertical resize. Change-Id: I4f8eb27f360e44140f9db7a80e57d299847ca0af Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8979 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- app/spdk_top/spdk_top.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/spdk_top/spdk_top.c b/app/spdk_top/spdk_top.c index ea880a2f38..e69b6ef5fa 100644 --- a/app/spdk_top/spdk_top.c +++ b/app/spdk_top/spdk_top.c @@ -2700,6 +2700,9 @@ show_stats(pthread_t *data_thread) getmaxyx(stdscr, max_row, max_col); if (max_row != g_max_row || max_col != g_max_col) { + if (max_row != g_max_row) { + current_page = 0; + } g_max_row = spdk_max(max_row, required_size); g_max_col = max_col; g_data_win_size = g_max_row - required_size + 1;