From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18305 invoked by alias); 27 Jul 2010 22:38:11 -0000 Received: (qmail 18295 invoked by uid 22791); 27 Jul 2010 22:38:10 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from mail-bw0-f41.google.com (HELO mail-bw0-f41.google.com) (209.85.214.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Jul 2010 22:38:05 +0000 Received: by bwz9 with SMTP id 9so4397230bwz.0 for ; Tue, 27 Jul 2010 15:38:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.103.199 with SMTP id l7mr7379035bko.18.1280270282302; Tue, 27 Jul 2010 15:38:02 -0700 (PDT) Received: by 10.204.18.144 with HTTP; Tue, 27 Jul 2010 15:38:02 -0700 (PDT) In-Reply-To: <201007271543.13838.pedro@codesourcery.com> References: <201007271543.13838.pedro@codesourcery.com> Date: Tue, 27 Jul 2010 22:38:00 -0000 Message-ID: Subject: Re: [patch] Correct origin calculation of command line window in TUI mode From: Balazs Kezes To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00453.txt.bz2 > Hmmm, I've tried all three patches together, and I still get a messed > up cmd window after a couple of resizes (e.g., start > maxized/unmaximize/maximize). Yeah, these 3 patches are not enough. There are two remaining modifications which need to be done: Yeah, these 3 patches are not enough. There are two remaining modifications which need to be done: 1) HAVE_RESIZE_TERM - to make sure ncurses knows about the terminal size. Somehow this needs to be added to the configuration. I'm not sure how to do this. Maybe I'll look into this sometime. 2) The readline modification in order to have correct sizes. I've already contacted the readline guys and they told me that this bug will be fixed in readline 6.2. Even after this there is a little annoyance that you need to press a key to actually resize and redraw everything, but this could be fixed by ungetc or with a similar hack. Here are the changelogs: This patch: 2010-07-26 Balazs Kezes * tui-win.c (tui_resize_all): Update the locator's origin's coordinates. The resizing patch: 2010-07-26 Balazs Kezes * tui-win.c (make_visible_with_new_height): Resize and move the command window with to the new size and position. The tui_resize_all patch: 2010-07-26 Balazs Kezes * tui-io.c (tui_handle_resize_during_io): Call tui_resize_all after a detecting a resize. * tui-win.c (tui_resize_all): Remove tui_set_win_resized_to (TRUE); because this function will be called when this is already true. -- Balazs On 7/27/10, Pedro Alves wrote: > On Wednesday 21 July 2010 22:02:13, Balazs Kezes wrote: >> The locator's (a small bar between source and command window) origin (the >> first >> row's index) is not updated in tui_resize_all and this outdated data is >> used to >> calculate the command window's origin. This patch fixes this by updating >> it. > > Hmmm, I've tried all three patches together, and I still get a messed > up cmd window after a couple of resizes (e.g., start > maxized/unmaximize/maximize). With just the "call tui_resize_all" > patch applied, and the one below in addition, I get somewhat better > result than with them all applied. Do you see something like that too? > > Makes me wonder where's the code that calculates all the initial > sub window sizes for first display, and whether we could make more reuse > out of it. > >> >> -- >> Balazs >> >> Index: tui-win.c >> =================================================================== >> RCS file: /cvs/src/src/gdb/tui/tui-win.c,v >> retrieving revision 1.47 >> diff -c -p -r1.47 tui-win.c >> *** tui-win.c 17 May 2010 22:21:43 -0000 1.47 >> --- tui-win.c 21 Jul 2010 20:56:49 -0000 >> *************** tui_resize_all (void) >> *** 712,717 **** >> --- 712,718 ---- >> else >> new_height = first_win->generic.height + split_diff; >> >> + locator->origin.y = new_height + 1; >> make_invisible_and_set_new_height (first_win, new_height); >> TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; >> TUI_CMD_WIN->generic.width += width_diff; >> > > > -- > Pedro Alves >