From patchwork Tue Sep 10 19:08:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34480 Received: (qmail 26024 invoked by alias); 10 Sep 2019 19:09:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25713 invoked by uid 89); 10 Sep 2019 19:09:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=scroll, revealed, Doing, H*r:esmtpa X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.146.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Sep 2019 19:09:05 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 7F6545012D2 for ; Tue, 10 Sep 2019 14:09:04 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 7lVgiocj92qH77lVgiinyt; Tue, 10 Sep 2019 14:09:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=IAp/PWG7Ko+wP/zIOOnuaFD0MpRXyi+AZ4vg1BZPXUE=; b=OTgsV1aguZZGixJ2uZI6p4Aw5e Si1HyLgJhP4VBmUp5SntqEkCbfObTusJMkdECJDUO9LyuGLRpDCOr8bU2Sby5tdpIs9pKgVv3hnRS UtgaCGZ9cBaJB23Rq8X0UF9ai; Received: from 71-218-73-27.hlrn.qwest.net ([71.218.73.27]:51788 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1i7lVg-000EcZ-3E; Tue, 10 Sep 2019 14:09:04 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 11/20] Set TUI locator height to 1 Date: Tue, 10 Sep 2019 13:08:48 -0600 Message-Id: <20190910190857.6562-12-tom@tromey.com> In-Reply-To: <20190910190857.6562-1-tom@tromey.com> References: <20190910190857.6562-1-tom@tromey.com> 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-10 Tom Tromey * 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. --- 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/tui/tui-layout.c b/gdb/tui/tui-layout.c index 33d3dd6cb87..03115a7baa1 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 163a5ad7255..6bfbb0e5ea6 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 d07a777360f..77044738ef6 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;