diff options
Diffstat (limited to 'gdb/tui/tui-wingeneral.c')
-rw-r--r-- | gdb/tui/tui-wingeneral.c | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 4331f63..e001a4c 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -30,13 +30,51 @@ #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. */ + +static bool suppress_output; + +/* See tui-data.h. */ + +tui_suppress_output::tui_suppress_output () + : 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 () +{ + suppress_output = m_saved_suppress; + if (!suppress_output) + doupdate (); + + for (const auto &win : all_tui_windows ()) + win->refresh_window (); +} + +/* See tui-data.h. */ + +void +tui_wrefresh (WINDOW *win) +{ + if (!suppress_output) + wrefresh (win); +} + /* See tui-data.h. */ void tui_gen_win_info::refresh_window () { if (handle != NULL) - wrefresh (handle.get ()); + tui_wrefresh (handle.get ()); } /* Draw a border arround the window. */ @@ -134,7 +172,11 @@ tui_gen_win_info::make_window () { handle.reset (newwin (height, width, y, x)); if (handle != NULL) - scrollok (handle.get (), TRUE); + { + if (suppress_output) + wnoutrefresh (handle.get ()); + scrollok (handle.get (), TRUE); + } } void |