[1/3] Refactor keypad calls to tui_set_win_focus_to

Message ID 20210607163003.621-1-ssbssa@yahoo.de
State New
Headers show
Series
  • [1/3] Refactor keypad calls to tui_set_win_focus_to
Related show

Commit Message

Mike Frysinger via Gdb-patches June 7, 2021, 4:30 p.m.
Previously it always was called after tui_set_win_focus_to, except it was
missing in tui_apply_current_layout.

gdb/ChangeLog:

2021-06-07  Hannes Domani  <ssbssa@yahoo.de>

	* tui/tui-data.c (tui_set_win_focus_to): Add keypad call.
	* tui/tui-win.c (tui_set_focus_command): Remove keypad call.
	* tui/tui.c (tui_rl_other_window): Likewise.
	(tui_enable): Likewise.
---
 gdb/tui/tui-data.c | 5 +++++
 gdb/tui/tui-win.c  | 1 -
 gdb/tui/tui.c      | 2 --
 3 files changed, 5 insertions(+), 3 deletions(-)

-- 
2.31.1

Comments

Mike Frysinger via Gdb-patches June 17, 2021, 2:54 p.m. | #1
This series is no longer useful, Pedro fixed the mouse problems in a much
better way.


Hannes


Am Montag, 7. Juni 2021, 18:30:55 MESZ hat Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> Folgendes geschrieben:

> Previously it always was called after tui_set_win_focus_to, except it was

> missing in tui_apply_current_layout.

>

> gdb/ChangeLog:

>

> 2021-06-07  Hannes Domani  <ssbssa@yahoo.de>

>

>     * tui/tui-data.c (tui_set_win_focus_to): Add keypad call.

>     * tui/tui-win.c (tui_set_focus_command): Remove keypad call.

>     * tui/tui.c (tui_rl_other_window): Likewise.

>     (tui_enable): Likewise.

> ---

> gdb/tui/tui-data.c | 5 +++++

> gdb/tui/tui-win.c  | 1 -

> gdb/tui/tui.c      | 2 --

> 3 files changed, 5 insertions(+), 3 deletions(-)

>

> diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c

> index 691459abe2a..89afdb429ba 100644

> --- a/gdb/tui/tui-data.c

> +++ b/gdb/tui/tui-data.c

> @@ -22,6 +22,7 @@

> #include "defs.h"

> #include "symtab.h"

> #include "tui/tui.h"

> +#include "tui/tui-command.h"

> #include "tui/tui-data.h"

> #include "tui/tui-win.h"

> #include "tui/tui-wingeneral.h"

> @@ -69,6 +70,10 @@ tui_set_win_focus_to (struct tui_win_info *win_info)

>       tui_unhighlight_win (win_with_focus);

>       win_with_focus = win_info;

>       tui_highlight_win (win_info);

> +

> +      /* Enable the keypad if any window except the command window has

> +    the focus.  */

> +      keypad (TUI_CMD_WIN->handle.get (), win_info != TUI_CMD_WIN);

>     }

> }

>

> diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c

> index 4e75a66a00e..094b503eae8 100644

> --- a/gdb/tui/tui-win.c

> +++ b/gdb/tui/tui-win.c

> @@ -703,7 +703,6 @@ tui_set_focus_command (const char *arg, int from_tty)

>     error (_("Window \"%s\" is not visible"), arg);

>

>   tui_set_win_focus_to (win_info);

> -  keypad (TUI_CMD_WIN->handle.get (), win_info != TUI_CMD_WIN);

>   printf_filtered (_("Focus set to %s window.\n"),

>           tui_win_with_focus ()->name ());

> }

> diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c

> index 529fc62c9ac..394c357cebb 100644

> --- a/gdb/tui/tui.c

> +++ b/gdb/tui/tui.c

> @@ -181,7 +181,6 @@ tui_rl_other_window (int count, int key)

>   if (win_info)

>     {

>       tui_set_win_focus_to (win_info);

> -      keypad (TUI_CMD_WIN->handle.get (), win_info != TUI_CMD_WIN);

>     }

>   return 0;

> }

> @@ -439,7 +438,6 @@ tui_enable (void)

>       tui_show_frame_info (0);

>       tui_set_initial_layout ();

>       tui_set_win_focus_to (TUI_SRC_WIN);

> -      keypad (TUI_CMD_WIN->handle.get (), TRUE);

>       wrefresh (TUI_CMD_WIN->handle.get ());

>       tui_finish_init = false;

>     }

> --

> 2.31.1

Patch

diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index 691459abe2a..89afdb429ba 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -22,6 +22,7 @@ 
 #include "defs.h"
 #include "symtab.h"
 #include "tui/tui.h"
+#include "tui/tui-command.h"
 #include "tui/tui-data.h"
 #include "tui/tui-win.h"
 #include "tui/tui-wingeneral.h"
@@ -69,6 +70,10 @@  tui_set_win_focus_to (struct tui_win_info *win_info)
       tui_unhighlight_win (win_with_focus);
       win_with_focus = win_info;
       tui_highlight_win (win_info);
+
+      /* Enable the keypad if any window except the command window has
+	 the focus.  */
+      keypad (TUI_CMD_WIN->handle.get (), win_info != TUI_CMD_WIN);
     }
 }
 
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 4e75a66a00e..094b503eae8 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -703,7 +703,6 @@  tui_set_focus_command (const char *arg, int from_tty)
     error (_("Window \"%s\" is not visible"), arg);
 
   tui_set_win_focus_to (win_info);
-  keypad (TUI_CMD_WIN->handle.get (), win_info != TUI_CMD_WIN);
   printf_filtered (_("Focus set to %s window.\n"),
 		   tui_win_with_focus ()->name ());
 }
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 529fc62c9ac..394c357cebb 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -181,7 +181,6 @@  tui_rl_other_window (int count, int key)
   if (win_info)
     {
       tui_set_win_focus_to (win_info);
-      keypad (TUI_CMD_WIN->handle.get (), win_info != TUI_CMD_WIN);
     }
   return 0;
 }
@@ -439,7 +438,6 @@  tui_enable (void)
       tui_show_frame_info (0);
       tui_set_initial_layout ();
       tui_set_win_focus_to (TUI_SRC_WIN);
-      keypad (TUI_CMD_WIN->handle.get (), TRUE);
       wrefresh (TUI_CMD_WIN->handle.get ());
       tui_finish_init = false;
     }