1 /* TUI layout window management.
3 Copyright (C) 1998-2019 Free Software Foundation, Inc.
5 Contributed by Hewlett-Packard Company.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "arch-utils.h"
31 #include "tui/tui-data.h"
32 #include "tui/tui-windata.h"
33 #include "tui/tui-wingeneral.h"
34 #include "tui/tui-stack.h"
35 #include "tui/tui-regs.h"
36 #include "tui/tui-win.h"
37 #include "tui/tui-winsource.h"
38 #include "tui/tui-disasm.h"
39 #include "tui/tui-layout.h"
40 #include "gdb_curses.h"
42 /*******************************
44 ********************************/
45 static void show_layout (enum tui_layout_type
);
46 static tui_gen_win_info
*init_and_make_win (tui_gen_win_info
*,
50 static void show_source_or_disasm_and_command (enum tui_layout_type
);
51 static struct tui_win_info
*make_source_or_disasm_window (enum tui_win_type
,
53 static struct tui_win_info
*make_command_window (int, int);
54 static struct tui_win_info
*make_source_window (int, int);
55 static struct tui_win_info
*make_disasm_window (int, int);
56 static void make_data_window (struct tui_win_info
**, int, int);
57 static void show_source_command (void);
58 static void show_disasm_command (void);
59 static void show_source_disasm_command (void);
60 static void show_data (enum tui_layout_type
);
61 static enum tui_layout_type
next_layout (void);
62 static enum tui_layout_type
prev_layout (void);
63 static void tui_layout_command (const char *, int);
64 static void extract_display_start_addr (struct gdbarch
**, CORE_ADDR
*);
67 /***************************************
69 ***************************************/
71 #define LAYOUT_USAGE "Usage: layout prev | next | <layout_name> \n"
73 /* Show the screen layout defined. */
75 show_layout (enum tui_layout_type layout
)
77 enum tui_layout_type cur_layout
= tui_current_layout ();
79 if (layout
!= cur_layout
)
81 /* Since the new layout may cause changes in window size, we
82 should free the content and reallocate on next display of
84 tui_free_all_source_wins_content ();
85 tui_clear_source_windows ();
86 if (layout
== SRC_DATA_COMMAND
87 || layout
== DISASSEM_DATA_COMMAND
)
90 tui_refresh_all (tui_win_list
);
94 /* First make the current layout be invisible. */
95 tui_make_all_invisible ();
96 tui_make_invisible (tui_locator_win_info_ptr ());
100 /* Now show the new layout. */
102 show_source_command ();
103 tui_add_to_source_windows (TUI_SRC_WIN
);
105 case DISASSEM_COMMAND
:
106 show_disasm_command ();
107 tui_add_to_source_windows (TUI_DISASM_WIN
);
109 case SRC_DISASSEM_COMMAND
:
110 show_source_disasm_command ();
111 tui_add_to_source_windows (TUI_SRC_WIN
);
112 tui_add_to_source_windows (TUI_DISASM_WIN
);
122 /* Function to set the layout to SRC_COMMAND, DISASSEM_COMMAND,
123 SRC_DISASSEM_COMMAND, SRC_DATA_COMMAND, or DISASSEM_DATA_COMMAND. */
125 tui_set_layout (enum tui_layout_type layout_type
)
127 enum tui_status status
= TUI_SUCCESS
;
129 if (layout_type
!= UNDEFINED_LAYOUT
)
131 enum tui_layout_type cur_layout
= tui_current_layout (),
132 new_layout
= UNDEFINED_LAYOUT
;
133 int regs_populate
= FALSE
;
134 struct gdbarch
*gdbarch
;
136 struct tui_win_info
*win_with_focus
= tui_win_with_focus ();
137 struct tui_layout_def
*layout_def
= tui_layout_def ();
139 extract_display_start_addr (&gdbarch
, &addr
);
141 new_layout
= layout_type
;
143 regs_populate
= (new_layout
== SRC_DATA_COMMAND
144 || new_layout
== DISASSEM_DATA_COMMAND
);
145 if (new_layout
!= cur_layout
)
147 show_layout (new_layout
);
149 /* Now determine where focus should be. */
150 if (win_with_focus
!= TUI_CMD_WIN
)
155 tui_set_win_focus_to (TUI_SRC_WIN
);
156 layout_def
->display_mode
= SRC_WIN
;
157 layout_def
->split
= FALSE
;
159 case DISASSEM_COMMAND
:
160 /* The previous layout was not showing code.
161 This can happen if there is no source
164 1. if the source file is in another dir OR
165 2. if target was compiled without -g
166 We still want to show the assembly though! */
168 tui_get_begin_asm_address (&gdbarch
, &addr
);
169 tui_set_win_focus_to (TUI_DISASM_WIN
);
170 layout_def
->display_mode
= DISASSEM_WIN
;
171 layout_def
->split
= FALSE
;
173 case SRC_DISASSEM_COMMAND
:
174 /* The previous layout was not showing code.
175 This can happen if there is no source
178 1. if the source file is in another dir OR
179 2. if target was compiled without -g
180 We still want to show the assembly though! */
182 tui_get_begin_asm_address (&gdbarch
, &addr
);
183 if (win_with_focus
== TUI_SRC_WIN
)
184 tui_set_win_focus_to (TUI_SRC_WIN
);
186 tui_set_win_focus_to (TUI_DISASM_WIN
);
187 layout_def
->split
= TRUE
;
189 case SRC_DATA_COMMAND
:
190 if (win_with_focus
!= TUI_DATA_WIN
)
191 tui_set_win_focus_to (TUI_SRC_WIN
);
193 tui_set_win_focus_to (TUI_DATA_WIN
);
194 layout_def
->display_mode
= SRC_WIN
;
195 layout_def
->split
= FALSE
;
197 case DISASSEM_DATA_COMMAND
:
198 /* The previous layout was not showing code.
199 This can happen if there is no source
202 1. if the source file is in another dir OR
203 2. if target was compiled without -g
204 We still want to show the assembly though! */
206 tui_get_begin_asm_address (&gdbarch
, &addr
);
207 if (win_with_focus
!= TUI_DATA_WIN
)
208 tui_set_win_focus_to (TUI_DISASM_WIN
);
210 tui_set_win_focus_to (TUI_DATA_WIN
);
211 layout_def
->display_mode
= DISASSEM_WIN
;
212 layout_def
->split
= FALSE
;
219 * Now update the window content.
222 && (new_layout
== SRC_DATA_COMMAND
223 || new_layout
== DISASSEM_DATA_COMMAND
))
224 tui_display_all_data ();
226 tui_update_source_windows_with_addr (gdbarch
, addr
);
229 tui_show_registers (TUI_DATA_WIN
->current_group
);
233 status
= TUI_FAILURE
;
238 /* Add the specified window to the layout in a logical way. This
239 means setting up the most logical layout given the window to be
242 tui_add_win_to_layout (enum tui_win_type type
)
244 enum tui_layout_type cur_layout
= tui_current_layout ();
249 if (cur_layout
!= SRC_COMMAND
250 && cur_layout
!= SRC_DISASSEM_COMMAND
251 && cur_layout
!= SRC_DATA_COMMAND
)
253 tui_clear_source_windows_detail ();
254 if (cur_layout
== DISASSEM_DATA_COMMAND
)
255 show_layout (SRC_DATA_COMMAND
);
257 show_layout (SRC_COMMAND
);
261 if (cur_layout
!= DISASSEM_COMMAND
262 && cur_layout
!= SRC_DISASSEM_COMMAND
263 && cur_layout
!= DISASSEM_DATA_COMMAND
)
265 tui_clear_source_windows_detail ();
266 if (cur_layout
== SRC_DATA_COMMAND
)
267 show_layout (DISASSEM_DATA_COMMAND
);
269 show_layout (DISASSEM_COMMAND
);
273 if (cur_layout
!= SRC_DATA_COMMAND
274 && cur_layout
!= DISASSEM_DATA_COMMAND
)
276 if (cur_layout
== DISASSEM_COMMAND
)
277 show_layout (DISASSEM_DATA_COMMAND
);
279 show_layout (SRC_DATA_COMMAND
);
288 /* Answer the height of a window. If it hasn't been created yet,
289 answer what the height of a window would be based upon its type and
292 tui_default_win_height (enum tui_win_type type
,
293 enum tui_layout_type layout
)
297 if (tui_win_list
[type
] != NULL
)
298 h
= tui_win_list
[type
]->height
;
304 case DISASSEM_COMMAND
:
305 if (TUI_CMD_WIN
== NULL
)
306 h
= tui_term_height () / 2;
308 h
= tui_term_height () - TUI_CMD_WIN
->height
;
310 case SRC_DISASSEM_COMMAND
:
311 case SRC_DATA_COMMAND
:
312 case DISASSEM_DATA_COMMAND
:
313 if (TUI_CMD_WIN
== NULL
)
314 h
= tui_term_height () / 3;
316 h
= (tui_term_height () - TUI_CMD_WIN
->height
) / 2;
328 /* Answer the height of a window. If it hasn't been created yet,
329 answer what the height of a window would be based upon its type and
332 tui_default_win_viewport_height (enum tui_win_type type
,
333 enum tui_layout_type layout
)
337 h
= tui_default_win_height (type
, layout
);
339 if (tui_win_list
[type
] == TUI_CMD_WIN
)
347 /* Complete possible layout names. TEXT is the complete text entered so
348 far, WORD is the word currently being completed. */
351 layout_completer (struct cmd_list_element
*ignore
,
352 completion_tracker
&tracker
,
353 const char *text
, const char *word
)
355 static const char *layout_names
[] =
356 { "src", "asm", "split", "regs", "next", "prev", NULL
};
358 complete_on_enum (tracker
, layout_names
, text
, word
);
361 /* Function to initialize gdb commands, for tui window layout
365 _initialize_tui_layout (void)
367 struct cmd_list_element
*cmd
;
369 cmd
= add_com ("layout", class_tui
, tui_layout_command
, _("\
370 Change the layout of windows.\n\
371 Usage: layout prev | next | LAYOUT-NAME\n\
373 src : Displays source and command windows.\n\
374 asm : Displays disassembly and command windows.\n\
375 split : Displays source, disassembly and command windows.\n\
376 regs : Displays register window. If existing layout\n\
377 is source/command or assembly/command, the \n\
378 register window is displayed. If the\n\
379 source/assembly/command (split) is displayed, \n\
380 the register window is displayed with \n\
381 the window that has current logical focus."));
382 set_cmd_completer (cmd
, layout_completer
);
386 /*************************
387 ** STATIC LOCAL FUNCTIONS
388 **************************/
391 /* Function to set the layout to SRC, ASM, SPLIT, NEXT, PREV, DATA, or
394 tui_set_layout_by_name (const char *layout_name
)
396 enum tui_status status
= TUI_SUCCESS
;
398 if (layout_name
!= NULL
)
401 enum tui_layout_type new_layout
= UNDEFINED_LAYOUT
;
402 enum tui_layout_type cur_layout
= tui_current_layout ();
404 std::string copy
= layout_name
;
405 for (i
= 0; i
< copy
.size (); i
++)
406 copy
[i
] = toupper (copy
[i
]);
407 const char *buf_ptr
= copy
.c_str ();
409 /* First check for ambiguous input. */
410 if (strlen (buf_ptr
) <= 1 && *buf_ptr
== 'S')
412 warning (_("Ambiguous command input."));
413 status
= TUI_FAILURE
;
417 if (subset_compare (buf_ptr
, "SRC"))
418 new_layout
= SRC_COMMAND
;
419 else if (subset_compare (buf_ptr
, "ASM"))
420 new_layout
= DISASSEM_COMMAND
;
421 else if (subset_compare (buf_ptr
, "SPLIT"))
422 new_layout
= SRC_DISASSEM_COMMAND
;
423 else if (subset_compare (buf_ptr
, "REGS"))
425 if (cur_layout
== SRC_COMMAND
426 || cur_layout
== SRC_DATA_COMMAND
)
427 new_layout
= SRC_DATA_COMMAND
;
429 new_layout
= DISASSEM_DATA_COMMAND
;
431 else if (subset_compare (buf_ptr
, "NEXT"))
432 new_layout
= next_layout ();
433 else if (subset_compare (buf_ptr
, "PREV"))
434 new_layout
= prev_layout ();
436 status
= TUI_FAILURE
;
438 if (status
== TUI_SUCCESS
)
440 /* Make sure the curses mode is enabled. */
442 tui_set_layout (new_layout
);
447 status
= TUI_FAILURE
;
454 extract_display_start_addr (struct gdbarch
**gdbarch_p
, CORE_ADDR
*addr_p
)
456 enum tui_layout_type cur_layout
= tui_current_layout ();
457 struct gdbarch
*gdbarch
= get_current_arch ();
460 struct symtab_and_line cursal
= get_current_source_symtab_and_line ();
465 case SRC_DATA_COMMAND
:
466 gdbarch
= TUI_SRC_WIN
->gdbarch
;
467 find_line_pc (cursal
.symtab
,
468 TUI_SRC_WIN
->start_line_or_addr
.u
.line_no
,
472 case DISASSEM_COMMAND
:
473 case SRC_DISASSEM_COMMAND
:
474 case DISASSEM_DATA_COMMAND
:
475 gdbarch
= TUI_DISASM_WIN
->gdbarch
;
476 addr
= TUI_DISASM_WIN
->start_line_or_addr
.u
.addr
;
483 *gdbarch_p
= gdbarch
;
489 tui_layout_command (const char *arg
, int from_tty
)
491 /* Switch to the selected layout. */
492 if (tui_set_layout_by_name (arg
) != TUI_SUCCESS
)
493 warning (_("Invalid layout specified.\n%s"), LAYOUT_USAGE
);
496 /* Answer the previous layout to cycle to. */
497 static enum tui_layout_type
502 new_layout
= tui_current_layout ();
503 if (new_layout
== UNDEFINED_LAYOUT
)
504 new_layout
= SRC_COMMAND
;
508 if (new_layout
== UNDEFINED_LAYOUT
)
509 new_layout
= SRC_COMMAND
;
512 return (enum tui_layout_type
) new_layout
;
516 /* Answer the next layout to cycle to. */
517 static enum tui_layout_type
522 new_layout
= tui_current_layout ();
523 if (new_layout
== SRC_COMMAND
)
524 new_layout
= DISASSEM_DATA_COMMAND
;
528 if (new_layout
== UNDEFINED_LAYOUT
)
529 new_layout
= DISASSEM_DATA_COMMAND
;
532 return (enum tui_layout_type
) new_layout
;
537 static struct tui_win_info
*
538 make_command_window (int height
, int origin_y
)
540 struct tui_win_info
*result
541 = (struct tui_win_info
*) init_and_make_win (NULL
,
552 /* make_source_window().
554 static struct tui_win_info
*
555 make_source_window (int height
, int origin_y
)
557 return make_source_or_disasm_window (SRC_WIN
, height
, origin_y
);
558 } /* make_source_window */
561 /* make_disasm_window().
563 static struct tui_win_info
*
564 make_disasm_window (int height
, int origin_y
)
566 return make_source_or_disasm_window (DISASSEM_WIN
, height
, origin_y
);
567 } /* make_disasm_window */
571 make_data_window (struct tui_win_info
**win_info_ptr
,
572 int height
, int origin_y
)
575 = (struct tui_win_info
*) init_and_make_win (*win_info_ptr
,
586 /* Show the Source/Command layout. */
588 show_source_command (void)
590 show_source_or_disasm_and_command (SRC_COMMAND
);
594 /* Show the Dissassem/Command layout. */
596 show_disasm_command (void)
598 show_source_or_disasm_and_command (DISASSEM_COMMAND
);
602 /* Show the Source/Disassem/Command layout. */
604 show_source_disasm_command (void)
606 if (tui_current_layout () != SRC_DISASSEM_COMMAND
)
608 int cmd_height
, src_height
, asm_height
;
610 if (TUI_CMD_WIN
!= NULL
)
611 cmd_height
= TUI_CMD_WIN
->height
;
613 cmd_height
= tui_term_height () / 3;
615 src_height
= (tui_term_height () - cmd_height
) / 2;
616 asm_height
= tui_term_height () - (src_height
+ cmd_height
);
618 if (TUI_SRC_WIN
== NULL
)
619 tui_win_list
[SRC_WIN
] = make_source_window (src_height
, 0);
622 TUI_SRC_WIN
->reset (TUI_SRC_WIN
->type
,
625 TUI_SRC_WIN
->execution_info
->width
,
627 TUI_SRC_WIN
->execution_info
->reset (EXEC_INFO_WIN
,
632 tui_make_visible (TUI_SRC_WIN
);
633 tui_make_visible (TUI_SRC_WIN
->execution_info
);
634 TUI_SRC_WIN
->m_has_locator
= false;
637 struct tui_locator_window
*locator
= tui_locator_win_info_ptr ();
638 gdb_assert (locator
!= nullptr);
640 tui_show_source_content (TUI_SRC_WIN
);
641 if (TUI_DISASM_WIN
== NULL
)
643 tui_win_list
[DISASSEM_WIN
]
644 = make_disasm_window (asm_height
, src_height
- 1);
645 init_and_make_win (locator
,
650 (src_height
+ asm_height
) - 1,
655 locator
->reset (LOCATOR_WIN
,
659 (src_height
+ asm_height
) - 1);
660 TUI_DISASM_WIN
->m_has_locator
= true;
661 TUI_DISASM_WIN
->reset (TUI_DISASM_WIN
->type
,
663 TUI_DISASM_WIN
->width
,
664 TUI_DISASM_WIN
->execution_info
->width
,
666 TUI_DISASM_WIN
->execution_info
->reset (EXEC_INFO_WIN
,
671 tui_make_visible (TUI_DISASM_WIN
);
672 tui_make_visible (TUI_DISASM_WIN
->execution_info
);
674 TUI_SRC_WIN
->m_has_locator
= false;
675 TUI_DISASM_WIN
->m_has_locator
= true;
676 tui_make_visible (locator
);
677 tui_show_locator_content ();
678 tui_show_source_content (TUI_DISASM_WIN
);
680 if (TUI_CMD_WIN
== NULL
)
681 tui_win_list
[CMD_WIN
]
682 = make_command_window (cmd_height
, tui_term_height () - cmd_height
);
685 TUI_CMD_WIN
->reset (TUI_CMD_WIN
->type
,
689 TUI_CMD_WIN
->origin
.y
);
690 tui_make_visible (TUI_CMD_WIN
);
692 TUI_CMD_WIN
->refresh_window ();
693 tui_set_current_layout_to (SRC_DISASSEM_COMMAND
);
698 /* Show the Source/Data/Command or the Dissassembly/Data/Command
701 show_data (enum tui_layout_type new_layout
)
703 int total_height
= (tui_term_height () - TUI_CMD_WIN
->height
);
704 int src_height
, data_height
;
705 enum tui_win_type win_type
;
707 struct tui_locator_window
*locator
= tui_locator_win_info_ptr ();
708 gdb_assert (locator
!= nullptr);
710 data_height
= total_height
/ 2;
711 src_height
= total_height
- data_height
;
712 tui_make_all_invisible ();
713 tui_make_invisible (locator
);
714 make_data_window (&tui_win_list
[DATA_WIN
], data_height
, 0);
715 if (new_layout
== SRC_DATA_COMMAND
)
718 win_type
= DISASSEM_WIN
;
720 tui_source_window_base
*base
;
721 if (tui_win_list
[win_type
] == NULL
)
723 if (win_type
== SRC_WIN
)
724 tui_win_list
[win_type
]
725 = make_source_window (src_height
, data_height
- 1);
727 tui_win_list
[win_type
]
728 = make_disasm_window (src_height
, data_height
- 1);
729 init_and_make_win (locator
,
736 base
= (tui_source_window_base
*) tui_win_list
[win_type
];
740 base
= (tui_source_window_base
*) tui_win_list
[win_type
];
741 tui_win_list
[win_type
]->reset (tui_win_list
[win_type
]->type
,
743 tui_win_list
[win_type
]->width
,
744 base
->execution_info
->width
,
746 base
->execution_info
->reset (EXEC_INFO_WIN
,
751 tui_make_visible (tui_win_list
[win_type
]);
752 tui_make_visible (base
->execution_info
);
753 locator
->reset (LOCATOR_WIN
,
759 base
->m_has_locator
= true;
760 tui_make_visible (locator
);
761 tui_show_locator_content ();
762 tui_add_to_source_windows
763 ((tui_source_window_base
*) tui_win_list
[win_type
]);
764 tui_set_current_layout_to (new_layout
);
768 tui_gen_win_info::reset (enum tui_win_type win_type
,
769 int height_
, int width_
,
770 int origin_x_
, int origin_y_
)
774 gdb_assert (type
== win_type
);
780 viewport_height
= h
- 1;
786 origin
.x
= origin_x_
;
787 origin
.y
= origin_y_
;
790 /* init_and_make_win().
792 static tui_gen_win_info
*
793 init_and_make_win (tui_gen_win_info
*win_info
,
794 enum tui_win_type win_type
,
795 int height
, int width
,
796 int origin_x
, int origin_y
,
799 if (win_info
== NULL
)
804 win_info
= new tui_source_window ();
808 win_info
= new tui_disasm_window ();
812 win_info
= new tui_data_window ();
816 win_info
= new tui_cmd_window ();
820 win_info
= new tui_exec_info_window ();
824 gdb_assert (tui_win_is_auxillary (win_type
));
825 win_info
= new tui_gen_win_info (win_type
);
830 win_info
->reset (win_type
, height
, width
, origin_x
, origin_y
);
831 tui_make_window (win_info
, box_it
);
837 static struct tui_win_info
*
838 make_source_or_disasm_window (enum tui_win_type type
,
839 int height
, int origin_y
)
841 struct tui_exec_info_window
*execution_info
842 = (tui_exec_info_window
*) init_and_make_win (nullptr,
850 /* Now create the source window. */
851 struct tui_source_window_base
*result
852 = ((struct tui_source_window_base
*)
853 init_and_make_win (NULL
,
856 tui_term_width () - execution_info
->width
,
857 execution_info
->width
,
860 result
->execution_info
= execution_info
;
865 /* Show the Source/Command or the Disassem layout. */
867 show_source_or_disasm_and_command (enum tui_layout_type layout_type
)
869 if (tui_current_layout () != layout_type
)
871 struct tui_win_info
**win_info_ptr
;
872 int src_height
, cmd_height
;
873 struct tui_locator_window
*locator
= tui_locator_win_info_ptr ();
874 gdb_assert (locator
!= nullptr);
876 if (TUI_CMD_WIN
!= NULL
)
877 cmd_height
= TUI_CMD_WIN
->height
;
879 cmd_height
= tui_term_height () / 3;
880 src_height
= tui_term_height () - cmd_height
;
882 if (layout_type
== SRC_COMMAND
)
883 win_info_ptr
= &tui_win_list
[SRC_WIN
];
885 win_info_ptr
= &tui_win_list
[DISASSEM_WIN
];
887 tui_source_window_base
*base
;
888 if ((*win_info_ptr
) == NULL
)
890 if (layout_type
== SRC_COMMAND
)
891 *win_info_ptr
= make_source_window (src_height
- 1, 0);
893 *win_info_ptr
= make_disasm_window (src_height
- 1, 0);
894 init_and_make_win (locator
,
901 base
= (tui_source_window_base
*) *win_info_ptr
;
905 base
= (tui_source_window_base
*) *win_info_ptr
;
906 locator
->reset (LOCATOR_WIN
,
911 base
->m_has_locator
= true;
912 (*win_info_ptr
)->reset ((*win_info_ptr
)->type
,
914 (*win_info_ptr
)->width
,
915 base
->execution_info
->width
,
917 base
->execution_info
->reset (EXEC_INFO_WIN
,
922 tui_make_visible (*win_info_ptr
);
923 tui_make_visible (base
->execution_info
);
926 base
->m_has_locator
= true;
927 tui_make_visible (locator
);
928 tui_show_locator_content ();
929 tui_show_source_content (*win_info_ptr
);
931 if (TUI_CMD_WIN
== NULL
)
933 tui_win_list
[CMD_WIN
] = make_command_window (cmd_height
,
935 TUI_CMD_WIN
->refresh_window ();
939 TUI_CMD_WIN
->reset (TUI_CMD_WIN
->type
,
942 TUI_CMD_WIN
->origin
.x
,
943 TUI_CMD_WIN
->origin
.y
);
944 tui_make_visible (TUI_CMD_WIN
);
946 tui_set_current_layout_to (layout_type
);