From 3f3ffe54e229482bdb0785ae2162f03d60870400 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 5 Jul 2019 12:29:18 -0600 Subject: Simplify tui_make_all_invisible This simplifies the implementation of tui_make_all_invisible. Also, because show_data is only called by show_layout, this hoists the call to tui_make_all_invisible and removes the call from show_data. gdb/ChangeLog 2019-08-13 Tom Tromey * tui/tui-wingeneral.c (make_all_visible): Remove. (tui_make_all_invisible): Simplify. * tui/tui-layout.c (tui_make_all_invisible): Move from tui-wingeneral.c; simplify. (show_layout): Hoist call to tui_make_all_invisible. (show_data): Don't call tui_make_all_invisible. --- gdb/tui/tui-layout.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'gdb/tui/tui-layout.c') diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c index 2b25e7a..3ee3354 100644 --- a/gdb/tui/tui-layout.c +++ b/gdb/tui/tui-layout.c @@ -80,6 +80,9 @@ show_layout (enum tui_layout_type layout) should free the content and reallocate on next display of source/asm. */ tui_clear_source_windows (); + /* First make the current layout be invisible. */ + tui_make_all_invisible (); + tui_locator_win_info_ptr ()->make_visible (false); if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND) { @@ -88,10 +91,6 @@ show_layout (enum tui_layout_type layout) } else { - /* First make the current layout be invisible. */ - tui_make_all_invisible (); - tui_locator_win_info_ptr ()->make_visible (false); - switch (layout) { /* Now show the new layout. */ @@ -571,8 +570,6 @@ show_data (enum tui_layout_type new_layout) data_height = total_height / 2; src_height = total_height - data_height; - tui_make_all_invisible (); - locator->make_visible (false); if (tui_win_list[DATA_WIN] == nullptr) tui_win_list[DATA_WIN] = new tui_data_window (); tui_win_list[DATA_WIN]->reset (data_height, tui_term_width (), 0, 0); -- cgit v1.1