aarch64: Normalize and sort feature bit macros
[deliverable/binutils-gdb.git] / gdb / tui / tui-wingeneral.c
index 0a9fc5238d6121ca59a772bd8f5cb656a4774310..35468d43abcd40612fe5a0f7de92246f077b36ac 100644 (file)
 
 #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
This page took 0.026173 seconds and 4 git commands to generate.