Don't check window type in tui_set_win_focus_to
authorTom Tromey <tom@tromey.com>
Thu, 20 Jun 2019 21:22:53 +0000 (15:22 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:44 +0000 (07:48 -0600)
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.

gdb/ChangeLog
2019-06-25  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
gdb/tui/tui-win.c
gdb/tui/tui-wingeneral.c

index bd8af641dc71005cd8e41c26d7c331991f91da16..48cfc36a46972f94e69f9204c2ac75c6258d9ea3 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-25  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.
+
 2019-06-25  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-win.c (tui_source_window_base::update_tab_width): Call
index 5ba683620f9434a5235c7763e43fc166ccf20996..b2eb0a643d8487d0476a932549d63d8dbe4468ec 100644 (file)
@@ -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);
     }
 }
 
index cfa4a08701cac0e7672e4c51b4a10a6e50adc966..98eb5abde16a0c8720930faaeb3ab1c98cd9d008 100644 (file)
@@ -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);