public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Set TUI locator height to 1
@ 2019-09-20 20:06 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-09-20 20:06 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1b935acf7ecc2df4649b7d34b7ac467eac07221b

commit 1b935acf7ecc2df4649b7d34b7ac467eac07221b
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Jul 24 16:37:48 2019 -0600

    Set TUI locator height to 1
    
    The TUI has long had code to resize the locator, using 2 as the
    height.  However the code has "1" in a comment, like:
    
        locator->resize (2 /* 1 */ ,
    
    This patch fixes the resizing code to set the height to 1.  Doing this
    revealed what was probably the reason for setting the height to 2 in
    the first place: this caused the locator window to scroll.  However,
    this is easily handled by calling scrollok on the locator window.
    
    gdb/ChangeLog
    2019-09-20  Tom Tromey  <tom@tromey.com>
    
    	* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use 1 as
    	height for locator.
    	* tui/tui-stack.c (tui_locator_window::rerender): Call scrollok.
    	* tui/tui-layout.c (show_source_disasm_command, show_data)
    	(show_source_or_disasm_and_command): Use 1 as height for locator.

Diff:
---
 gdb/ChangeLog        |  8 ++++++++
 gdb/tui/tui-layout.c | 18 ++++++------------
 gdb/tui/tui-stack.c  |  1 +
 gdb/tui/tui-win.c    |  9 ++++-----
 4 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e36b54f..9bc6f26 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
 2019-09-20  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use 1 as
+	height for locator.
+	* tui/tui-stack.c (tui_locator_window::rerender): Call scrollok.
+	* tui/tui-layout.c (show_source_disasm_command, show_data)
+	(show_source_or_disasm_and_command): Use 1 as height for locator.
+
+2019-09-20  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui.c (tui_enable): Update.
 	* tui/tui-win.c (tui_sigwinch_handler, tui_async_resize_screen):
 	Update.
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 33d3dd6..03115a7 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -511,10 +511,8 @@ show_source_disasm_command (void)
 			  tui_term_width (),
 			  0,
 			  src_height - 1);
-  locator->resize (2 /* 1 */ ,
-		   tui_term_width (),
-		   0,
-		   (src_height + asm_height) - 1);
+  locator->resize (1, tui_term_width (),
+		   0, (src_height + asm_height) - 1);
 
   if (TUI_CMD_WIN == NULL)
     tui_win_list[CMD_WIN] = new tui_cmd_window ();
@@ -561,10 +559,8 @@ show_data (enum tui_layout_type new_layout)
 				  tui_term_width (),
 				  0,
 				  data_height - 1);
-  locator->resize (2 /* 1 */ ,
-		   tui_term_width (),
-		   0,
-		   total_height - 1);
+  locator->resize (1, tui_term_width (),
+		   0, total_height - 1);
   TUI_CMD_WIN->resize (TUI_CMD_WIN->height, tui_term_width (),
 		       0, total_height);
 
@@ -635,10 +631,8 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
       win_info = TUI_DISASM_WIN;
     }
 
-  locator->resize (2 /* 1 */ ,
-		   tui_term_width (),
-		   0,
-		   src_height - 1);
+  locator->resize (1, tui_term_width (),
+		   0, src_height - 1);
   win_info->resize (src_height - 1,
 		    tui_term_width (),
 		    0,
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index 163a5ad..6bfbb0e 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -229,6 +229,7 @@ tui_locator_window::rerender ()
   if (handle != NULL)
     {
       std::string string = make_status_line ();
+      scrollok (handle, FALSE);
       wmove (handle, 0, 0);
       /* We ignore the return value from wstandout and wstandend, casting
 	 them to void in order to avoid a compiler warning.  The warning
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index d07a777..7704473 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -580,8 +580,7 @@ tui_resize_all (void)
 
 	  src_win->resize (new_height, screenwidth, 0, 0);
 
-	  locator->resize (2 /* 1 */, screenwidth,
-			   0, new_height);
+	  locator->resize (1, screenwidth, 0, new_height);
 
 	  new_height = screenheight - (new_height + 1);
 	  TUI_CMD_WIN->resize (new_height, screenwidth,
@@ -637,7 +636,7 @@ tui_resize_all (void)
 	  second_win->resize (new_height, screenwidth,
 			      0, first_win->height - 1);
 
-	  locator->resize (2 /* 1 */, screenwidth,
+	  locator->resize (1, screenwidth,
 			   0, second_win->origin.y + new_height);
 
 	  /* Change the command window's height/width.  */
@@ -1119,7 +1118,7 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
 		  second_win->resize (second_win->height + second_split_diff,
 				      width,
 				      0, first_win->height - 1);
-		  locator->resize (2 /* 1 */, width,
+		  locator->resize (1, width,
 				   0, (second_win->origin.y
 				       + second_win->height + 1));
 
@@ -1155,7 +1154,7 @@ tui_adjust_win_heights (struct tui_win_info *primary_win_info,
 		  else
 		    second_win->resize (second_win->height, width,
 					0, first_win->height - 1);
-		  locator->resize (2 /* 1 */, width,
+		  locator->resize (1, width,
 				   0, (second_win->origin.y
 				       + second_win->height + 1));
 		  TUI_CMD_WIN->origin.y = locator->origin.y + 1;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-20 20:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 20:06 [binutils-gdb] Set TUI locator height to 1 Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).