Commit d8ccfa34 authored by Krzysztof Karas's avatar Krzysztof Karas Committed by Tomasz Zawadzki
Browse files

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: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8979


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 5a851599
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;