X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ftui%2Ftui-wingeneral.c;h=35468d43abcd40612fe5a0f7de92246f077b36ac;hb=359157df2087894563a900e5f63299b42f460be2;hp=0a9fc5238d6121ca59a772bd8f5cb656a4774310;hpb=7c392d1de1400202eb86f7679628c4b7c14f8108;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 0a9fc5238d..35468d43ab 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. */ @@ -75,13 +113,13 @@ box_win (struct tui_win_info *win_info, 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); @@ -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 @@ -160,15 +202,6 @@ tui_gen_win_info::make_visible (bool visible) 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