From patchwork Mon Sep 1 01:25:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 2611 Received: (qmail 9249 invoked by alias); 1 Sep 2014 01:25:25 -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 9239 invoked by uid 89); 1 Sep 2014 01:25:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-qa0-f51.google.com Received: from mail-qa0-f51.google.com (HELO mail-qa0-f51.google.com) (209.85.216.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 01 Sep 2014 01:25:23 +0000 Received: by mail-qa0-f51.google.com with SMTP id j7so4312400qaq.38 for ; Sun, 31 Aug 2014 18:25:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qpnloVlJC5d6uW1k7dIsGkgW7f/EggLXxuAESCXNOpo=; b=iU4IW1SeoAUhuiyOhIL9t+WQ8a2lisX2kI/ufnGUmRssec53NSxrrXZttnMleoVwLH 8MlIRdLnen7QIPCWDoR0XFMDUR+qLtjZULso255ZEg+S9izi6pmFfsipCtxTWY/wcW2Z T+k0z9bcappIbk73TrLbRWA7a1OFJ33F0eR4nw6zkTf6DQvd9tsGwozkOY8DDLt3qPst 8b5FLHwjtLrrJ+D7ZVNT3P/EwZHwX26/EDeDAOpqD8h/Gk5S9gtYe8ozLrriOq2eDbX/ vMWnvF/BTxAKm0/BiZAA+2ryFCLyI9CdAuplkUsongZAdK/JLjxrzHqzOv/qqus2ghn3 etMg== X-Gm-Message-State: ALoCoQmIHaMffP5vaOByZG8QtX6L0BC0YQHEoSGKgkBi9aKeAkeu5U+I88cnH/G7bNCFnwlIba2D X-Received: by 10.140.107.198 with SMTP id h64mr37727858qgf.42.1409534721600; Sun, 31 Aug 2014 18:25:21 -0700 (PDT) Received: from localhost.localdomain (ool-4353af5c.dyn.optonline.net. [67.83.175.92]) by mx.google.com with ESMTPSA id l46sm10011276qgd.27.2014.08.31.18.25.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 31 Aug 2014 18:25:20 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH] Ensure rl_get_screen_size() returns the actual terminal dimensions Date: Sun, 31 Aug 2014 21:25:08 -0400 Message-Id: <1409534708-31981-1-git-send-email-patrick@parcs.ath.cx> X-IsSubscribed: yes We should call rl_resize_terminal() before calling rl_get_screen_size() to help ensure that rl_get_screen_size() will return the correct terminal dimensions. Doing so fixes a couple issues where TUI does not correctly resize itself due to rl_get_screen_size() returning stale terminal dimensions. * tui/tui-win.c (tui_resize_all): Call rl_resize_terminal before calling rl_get_screen_size. --- gdb/tui/tui-win.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index b117634..05539fe 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -655,6 +655,7 @@ tui_resize_all (void) int height_diff, width_diff; int screenheight, screenwidth; + rl_resize_terminal (); rl_get_screen_size (&screenheight, &screenwidth); width_diff = screenwidth - tui_term_width (); height_diff = screenheight - tui_term_height ();