diff options
author | Hannes Domani <ssbssa@yahoo.de> | 2020-12-21 14:26:29 +0100 |
---|---|---|
committer | Hannes Domani <ssbssa@yahoo.de> | 2021-01-05 14:08:26 +0100 |
commit | 5519536196e670c3c0fb2b138acc44049227e724 (patch) | |
tree | 0fc0eb0f75778e15aaa627140d618dcbebe6fd9e | |
parent | 1b6d4bb2232ff9fd692a332a491b95b5f4052dfe (diff) | |
download | gdb-5519536196e670c3c0fb2b138acc44049227e724.zip gdb-5519536196e670c3c0fb2b138acc44049227e724.tar.gz gdb-5519536196e670c3c0fb2b138acc44049227e724.tar.bz2 |
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 <ssbssa@yahoo.de>
* tui/tui-winsource.c (tui_source_window_base::refresh_window):
Call wnoutrefresh instead of tui_win_info::refresh_window.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/tui/tui-winsource.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 20ceaa2..4a7d801 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 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): Redraw second space after line number. diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 55b66e1..40fd00f 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 (); |