Prevent flickering when redrawing the TUI source window
authorHannes Domani <ssbssa@yahoo.de>
Mon, 21 Dec 2020 13:26:29 +0000 (14:26 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Tue, 5 Jan 2021 13:08:26 +0000 (14:08 +0100)
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  <ssbssa@yahoo.de>

* tui/tui-winsource.c (tui_source_window_base::refresh_window):
Call wnoutrefresh instead of tui_win_info::refresh_window.

gdb/ChangeLog
gdb/tui/tui-winsource.c

index 20ceaa26ae7195dacfeba7ac12822ed94d43c9bc..4a7d801edb6a58f1dac485f6b3ace09716a7ade1 100644 (file)
@@ -1,3 +1,8 @@
+2021-01-05  Hannes Domani  <ssbssa@yahoo.de>
+
+       * tui/tui-winsource.c (tui_source_window_base::refresh_window):
+       Call wnoutrefresh instead of tui_win_info::refresh_window.
+
 2021-01-05  Hannes Domani  <ssbssa@yahoo.de>
 
        * tui/tui-source.c (tui_source_window::show_line_number):
index 55b66e1bc1670f20b7b692be21ab2873972243d0..40fd00fa7700a8bcaeb1ff7d10e863bb451360b4 100644 (file)
@@ -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 ();