From 5519536196e670c3c0fb2b138acc44049227e724 Mon Sep 17 00:00:00 2001 From: Hannes Domani Date: Mon, 21 Dec 2020 14:26:29 +0100 Subject: [PATCH] Prevent flickering when redrawing the TUI source window tui_win_info::refresh_window simply calls wrefresh, which internally does a doupdate. This redraws the source background window without the source pad. Then prefresh of the source pad draws the actual source code on top, which flickers. By changing this to wnoutrefresh, the actual drawing on the screen is only done once in the following prefresh, without flickering. gdb/ChangeLog: 2021-01-05 Hannes Domani * tui/tui-winsource.c (tui_source_window_base::refresh_window): Call wnoutrefresh instead of tui_win_info::refresh_window. --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-winsource.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 20ceaa26ae7..4a7d801edb6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2021-01-05 Hannes Domani + + * tui/tui-winsource.c (tui_source_window_base::refresh_window): + Call wnoutrefresh instead of tui_win_info::refresh_window. + 2021-01-05 Hannes Domani * tui/tui-source.c (tui_source_window::show_line_number): diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 55b66e1bc16..40fd00fa770 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -252,7 +252,9 @@ tui_source_window_base::show_source_line (int lineno) void tui_source_window_base::refresh_window () { - tui_win_info::refresh_window (); + /* tui_win_info::refresh_window would draw the empty background window to + the screen, potentially creating a flicker. */ + wnoutrefresh (handle.get ()); int pad_width = std::max (m_max_length, width); int left_margin = 1 + TUI_EXECINFO_SIZE + extra_margin (); -- 2.30.2