Remove m_has_locator
[deliverable/binutils-gdb.git] / gdb / tui / tui-layout.c
index 4ea604a1017f4426a9920cf2cc4a727c58f27513..b7c5ed63c64ed0bacf3e0d514e63405d416eb74f 100644 (file)
@@ -76,9 +76,7 @@ show_layout (enum tui_layout_type layout)
 
   if (layout != cur_layout)
     {
-      /* First make the current layout be invisible.  */
       tui_make_all_invisible ();
-      tui_locator_win_info_ptr ()->make_visible (false);
       switch (layout)
        {
        case SRC_DATA_COMMAND:
@@ -506,8 +504,6 @@ show_source_disasm_command (void)
                       tui_term_width (),
                       0,
                       0);
-  TUI_SRC_WIN->make_visible (true);
-  TUI_SRC_WIN->m_has_locator = false;
 
   struct tui_locator_window *locator = tui_locator_win_info_ptr ();
   gdb_assert (locator != nullptr);
@@ -519,15 +515,10 @@ show_source_disasm_command (void)
                          tui_term_width (),
                          0,
                          src_height - 1);
-  TUI_DISASM_WIN->make_visible (true);
   locator->resize (2 /* 1 */ ,
                   tui_term_width (),
                   0,
                   (src_height + asm_height) - 1);
-  TUI_SRC_WIN->m_has_locator = false;
-  TUI_DISASM_WIN->m_has_locator = true;
-  locator->make_visible (true);
-  tui_show_locator_content ();
   TUI_DISASM_WIN->show_source_content ();
 
   if (TUI_CMD_WIN == NULL)
@@ -536,7 +527,6 @@ show_source_disasm_command (void)
                       tui_term_width (),
                       0,
                       tui_term_height () - cmd_height);
-  TUI_CMD_WIN->make_visible (true);
   current_layout = SRC_DISASSEM_COMMAND;
 }
 
@@ -558,7 +548,6 @@ show_data (enum tui_layout_type new_layout)
   if (tui_win_list[DATA_WIN] == nullptr)
     tui_win_list[DATA_WIN] = new tui_data_window ();
   tui_win_list[DATA_WIN]->resize (data_height, tui_term_width (), 0, 0);
-  tui_win_list[DATA_WIN]->make_visible (true);
 
   if (new_layout == SRC_DATA_COMMAND)
     win_type = SRC_WIN;
@@ -573,8 +562,6 @@ show_data (enum tui_layout_type new_layout)
        tui_win_list[win_type] = new tui_disasm_window ();
     }
 
-  tui_source_window_base *base
-    = (tui_source_window_base *) tui_win_list[win_type];
   tui_win_list[win_type]->resize (src_height,
                                  tui_term_width (),
                                  0,
@@ -583,11 +570,9 @@ show_data (enum tui_layout_type new_layout)
                   tui_term_width (),
                   0,
                   total_height - 1);
-  base->make_visible (true);
-  base->m_has_locator = true;
-  locator->make_visible (true);
-  tui_show_locator_content ();
-  TUI_CMD_WIN->make_visible (true);
+  TUI_CMD_WIN->resize (TUI_CMD_WIN->height, tui_term_width (),
+                      0, total_height);
+
   current_layout = new_layout;
 }
 
@@ -595,20 +580,31 @@ void
 tui_gen_win_info::resize (int height_, int width_,
                          int origin_x_, int origin_y_)
 {
-  int h = height_;
-
   width = width_;
-  height = h;
-  if (h > 1)
-    {
-      viewport_height = h - 1;
-      if (type != CMD_WIN)
-       viewport_height--;
-    }
+  height = height_;
+  if (height > 1)
+    viewport_height = height - 2;
   else
     viewport_height = 1;
   origin.x = origin_x_;
   origin.y = origin_y_;
+
+  if (handle != nullptr)
+    {
+#ifdef HAVE_WRESIZE
+      wresize (handle, height, width);
+      mvwin (handle, origin.y, origin.x);
+      wmove (handle, 0, 0);
+#else
+      tui_delete_win (handle);
+      handle = NULL;
+#endif
+    }
+
+  if (handle == nullptr)
+    tui_make_window (this);
+
+  rerender ();
 }
 
 /* Show the Source/Command or the Disassem layout.  */
@@ -647,12 +643,7 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
                    tui_term_width (),
                    0,
                    0);
-  win_info->make_visible (true);
-
 
-  win_info->m_has_locator = true;
-  locator->make_visible (true);
-  tui_show_locator_content ();
   win_info->show_source_content ();
 
   if (TUI_CMD_WIN == NULL)
@@ -661,6 +652,5 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
                       tui_term_width (),
                       0,
                       src_height);
-  TUI_CMD_WIN->make_visible (true);
   current_layout = layout_type;
 }
This page took 0.024369 seconds and 4 git commands to generate.