[47/66] Don't check window type in tui_set_win_focus_to
Commit Message
This changes tui_set_win_focus_to so that it no longer checks the
window type. Instead, now tui_unhighlight_win also checks whether the
window can be highlighted.
2019-06-23 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_set_win_focus_to): Don't check window type.
* tui/tui-wingeneral.c (tui_unhighlight_win): Check
can_highlight.
---
gdb/ChangeLog | 6 ++++++
gdb/tui/tui-win.c | 7 ++-----
gdb/tui/tui-wingeneral.c | 1 +
3 files changed, 9 insertions(+), 5 deletions(-)
@@ -458,12 +458,9 @@ tui_set_win_focus_to (struct tui_win_info *win_info)
{
struct tui_win_info *win_with_focus = tui_win_with_focus ();
- if (win_with_focus != NULL
- && win_with_focus->type != CMD_WIN)
- tui_unhighlight_win (win_with_focus);
+ tui_unhighlight_win (win_with_focus);
tui_set_win_with_focus (win_info);
- if (win_info->type != CMD_WIN)
- tui_highlight_win (win_info);
+ tui_highlight_win (win_info);
}
}
@@ -108,6 +108,7 @@ void
tui_unhighlight_win (struct tui_win_info *win_info)
{
if (win_info != NULL
+ && win_info->can_highlight
&& win_info->handle != NULL)
{
box_win (win_info, NO_HILITE);