aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-wingeneral.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-12-17 12:52:33 -0700
committerTom Tromey <tom@tromey.com>2024-09-07 14:23:04 -0600
commitd3acf3d759d085df544687b39a0c2900d3117bf7 (patch)
treea27f2f8f6e7814b3d1e24ebb159637412084beb6 /gdb/tui/tui-wingeneral.c
parent8f934adf59f11dd6c187c09521f7e7d84abcefbe (diff)
downloadgdb-d3acf3d759d085df544687b39a0c2900d3117bf7.zip
gdb-d3acf3d759d085df544687b39a0c2900d3117bf7.tar.gz
gdb-d3acf3d759d085df544687b39a0c2900d3117bf7.tar.bz2
Rename tui_suppress_output
This patch renames tui_suppress_output to the more descriptive tui_batch_rendering. This code was never really correct, and was based on a misunderstanding of the curses API. The updated comments describe the intended use of this class. This also removes the erroneous tui_win_info::no_refresh. wnoutrefresh does not prevent any output; rather, it copies from one curses buffer to another but (unlike woutrefresh) without then flushing to the screen. tui_batch_rendering now works in the correct way: calling doupdate in the destructor of the outermost instance, thus batching all screen output until that point. The patch adds instantiations of tui_batch_rendering to various spots, to make sure it is active when refreshing.
Diffstat (limited to 'gdb/tui/tui-wingeneral.c')
-rw-r--r--gdb/tui/tui-wingeneral.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index d113d77..963a165 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -27,33 +27,27 @@
#include "gdb_curses.h"
-/* This is true if we're currently suppressing output, via
- wnoutrefresh. This is needed in case we create a new window while
- in this mode. */
+/* This is true when there is a live instance of tui_batch_rendering.
+ The outermost tui_batch_rendering will cause a flush to the
+ screen. */
static bool suppress_output;
/* See tui-data.h. */
-tui_suppress_output::tui_suppress_output ()
+tui_batch_rendering::tui_batch_rendering ()
: m_saved_suppress (suppress_output)
{
suppress_output = true;
-
- for (const auto &win : all_tui_windows ())
- win->no_refresh ();
}
/* See tui-data.h. */
-tui_suppress_output::~tui_suppress_output ()
+tui_batch_rendering::~tui_batch_rendering ()
{
suppress_output = m_saved_suppress;
if (!suppress_output)
doupdate ();
-
- for (const auto &win : all_tui_windows ())
- win->refresh_window ();
}
/* See tui-data.h. */
@@ -61,8 +55,7 @@ tui_suppress_output::~tui_suppress_output ()
void
tui_wrefresh (WINDOW *win)
{
- if (!suppress_output)
- wrefresh (win);
+ wnoutrefresh (win);
}
/* See tui-data.h. */