Remove some unnecessary focus switches
authorTom Tromey <tom@tromey.com>
Wed, 13 Nov 2019 00:15:12 +0000 (17:15 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 20 Dec 2019 16:15:51 +0000 (09:15 -0700)
A couple of lower-level utility functions can change the TUI focus.
This seems incorrect to me -- focus switches should only be done
either by explicit user request, or ass a side effect of changing the
layout.

gdb/ChangeLog
2019-12-20  Tom Tromey  <tom@tromey.com>

* tui/tui-winsource.c
(tui_source_window_base::update_source_window_as_is): Don't switch focus.
* tui/tui-disasm.c (tui_show_disassem): Don't switch focus.

Change-Id: I0a5bb8a407cf8d52e2fd23b0598eb9bce56b1251

gdb/ChangeLog
gdb/tui/tui-disasm.c
gdb/tui/tui-winsource.c

index 9ac1430ee0be0360d651babd195f89980991da29..0ef7b0c63b06323ac2ac67a9ef72cbd62b2d586c 100644 (file)
@@ -1,3 +1,9 @@
+2019-12-20  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-winsource.c
+       (tui_source_window_base::update_source_window_as_is): Don't switch focus.
+       * tui/tui-disasm.c (tui_show_disassem): Don't switch focus.
+
 2019-12-20  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-winsource.h (struct tui_source_window_base)
index 63d581bd683607642c05594d1ab4f302d5031216..11c8b30d615a8c419f476d1111eed0410aec340e 100644 (file)
@@ -260,7 +260,6 @@ void
 tui_show_disassem (struct gdbarch *gdbarch, CORE_ADDR start_addr)
 {
   struct symtab *s = find_pc_line_symtab (start_addr);
-  struct tui_win_info *win_with_focus = tui_win_with_focus ();
   struct tui_line_or_address val;
 
   gdb_assert (TUI_DISASM_WIN != nullptr && TUI_DISASM_WIN->is_visible ());
@@ -268,12 +267,6 @@ tui_show_disassem (struct gdbarch *gdbarch, CORE_ADDR start_addr)
   val.loa = LOA_ADDRESS;
   val.u.addr = start_addr;
   TUI_DISASM_WIN->update_source_window (gdbarch, s, val);
-
-  /* If the focus was in the src win, put it in the asm win, if the
-     source view isn't split.  */
-  if (tui_current_layout () != SRC_DISASSEM_COMMAND 
-      && win_with_focus == TUI_SRC_WIN)
-    tui_set_win_focus_to (TUI_DISASM_WIN);
 }
 
 void
index fe1eb8fc333684ed187ef28f38121a5bc4daf0e2..72fbd46c7efcb35dcce3584836f85cf7e74bd82b 100644 (file)
@@ -201,11 +201,6 @@ tui_source_window_base::update_source_window_as_is
          sal.symtab = s;
          sal.pspace = SYMTAB_PSPACE (s);
          set_current_source_symtab_and_line (sal);
-         /* If the focus was in the asm win, put it in the src win if
-            we don't have a split layout.  */
-         if (tui_win_with_focus () == TUI_DISASM_WIN
-             && tui_current_layout () != SRC_DISASSEM_COMMAND)
-           tui_set_win_focus_to (this);
        }
     }
 }
This page took 0.031959 seconds and 4 git commands to generate.