#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. */
int max_len = win_info->width - 2 - 2;
if (win_info->title.size () <= max_len)
- mvwaddstr (win, 0, 3, win_info->title.c_str ());
+ mvwaddstr (win, 0, 2, win_info->title.c_str ());
else
{
std::string truncated
= "..." + win_info->title.substr (win_info->title.size ()
- max_len + 3);
- mvwaddstr (win, 0, 3, truncated.c_str ());
+ mvwaddstr (win, 0, 2, truncated.c_str ());
}
}
wattroff (win, attrs);
{
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
handle.reset (nullptr);
}
-/* See tui-wingeneral.h. */
-
-void
-tui_make_all_invisible (void)
-{
- for (tui_win_info *win_info : all_tui_windows ())
- win_info->make_visible (false);
-}
-
/* Function to refresh all the windows currently displayed. */
void