From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26109 invoked by alias); 5 Jan 2015 19:11:39 -0000 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 Received: (qmail 26096 invoked by uid 89); 5 Jan 2015 19:11:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 05 Jan 2015 19:11:35 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t05JBWYF001219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Jan 2015 14:11:33 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t05JBNvc008056; Mon, 5 Jan 2015 14:11:27 -0500 Message-ID: <54AAE1D9.9000409@redhat.com> Date: Mon, 05 Jan 2015 19:11:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [PATCHSET] [2/4] Fix various issue in TUI References: <83y4pnbtnc.fsf@gnu.org> In-Reply-To: <83y4pnbtnc.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-01/txt/msg00053.txt.bz2 On 12/31/2014 05:45 PM, Eli Zaretskii wrote: > This patch fixes the problem whereby setting the border attributes had > no effect whatsoever. Rather, you need to switch out of the TUI and back, with c-x,a. > Turns out no one was calling the functions that > detected changes in these settings and applied them to windows. Thanks. > While at that, this also fixes a copy/paste error in a comment to a > function. Could you please push this part separately? > > OK? > > 2014-12-31 Eli Zaretskii > > * tui/tui-win.c (tui_rehighlight_all): New function. > No empty lines between ChangeLog entries, please. > * tui/tui-win.h: Add prototype for tui_rehighlight_all. > > * tui/tui-command.c (tui_dispatch_ctrl_char): When Ctrl-L was > pressed, call tui_rehighlight_all if tui_update_variables > indicates it should be. tabs vs spaces. > > * tui/tui-win.c (tui_refresh_all_command): Call > tui_rehighlight_all if tui_update_variables indicates it > should be. > > * tui/tui-hooks.c (tui_note_setting_change): New function. > (tui_install_hooks): Install an observer for "command > parameter changed". > (tui_remove_hooks): Uninstall the observer. > > > --- gdb/tui/tui-win.h~0 2014-06-11 18:34:41 +0300 > +++ gdb/tui/tui-win.h 2014-12-31 13:38:18 +0200 > @@ -35,6 +35,7 @@ > extern void tui_set_win_focus_to (struct tui_win_info *); > extern void tui_resize_all (void); > extern void tui_refresh_all_win (void); > +extern void tui_rehighlight_all (void); > > extern chtype tui_border_ulcorner; > extern chtype tui_border_urcorner; > > > --- gdb/tui/tui-command.c~0 2014-10-29 21:45:50 +0200 > +++ gdb/tui/tui-command.c 2014-12-31 13:49:43 +0200 > @@ -50,7 +50,12 @@ Seems like you're not using git diff to generate the diffs for some reason. If using GNU diff, could you make sure to use the "-p" switch? It makes review a lot easier. > > --- gdb/tui/tui-command.c~0 2014-10-29 21:45:50 +0200 > +++ gdb/tui/tui-command.c 2014-12-31 13:49:43 +0200 > @@ -50,7 +50,12 @@ > > /* Handle the CTRL-L refresh for each window. */ > if (ch == '\f') > - tui_refresh_all_win (); > + { > + if (tui_update_variables ()) > + tui_rehighlight_all (); > + > + tui_refresh_all_win (); tui_refresh_all_win already calls tui_check_and_display_highlight_if_needed, so why do we need to call tui_rehighlight_all? Is it the tui_update_variables call that is really missing? But why would we need to call tui_update_variables on CTRL-L, if we already call it when the user changes the variables? > + } > > /* If the command window has the logical focus, or no-one does > assume it is the command window; in this case, pass the character > > > --- gdb/tui/tui-hooks.c~0 2014-06-11 18:34:41 +0300 > +++ gdb/tui/tui-hooks.c 2014-12-31 14:41:11 +0200 > @@ -247,12 +247,23 @@ > tui_display_main (); > } > > +/* Refresh the display when settings important to us change. */ > +static void > +tui_note_setting_change (const char *param, const char *value) > +{ > + if (tui_active > + && strncmp (param, "tui ", sizeof ("tui ") - 1) == 0 > + && tui_update_variables ()) > + tui_rehighlight_all (); > +} > + Please do this from the "set" hook of the relevant commands instead. IOW, replace NULL below (and in the other commands): add_setshow_enum_cmd ("active-border-mode", no_class, tui_border_mode_enums, &tui_active_border_mode, _("\ ... NULL, show_tui_active_border_mode, &tui_setlist, &tui_showlist); > @@ -985,11 +995,14 @@ > /* Make sure the curses mode is enabled. */ > tui_enable (); > > + if (tui_update_variables ()) > + tui_rehighlight_all (); > + > tui_refresh_all_win (); > } > I don't understand this one. When is it ever necessary? Thanks, Pedro Alves