From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6CC1A3857C74 for ; Thu, 31 Dec 2020 04:24:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6CC1A3857C74 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 0BV4OChJ009252 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Dec 2020 23:24:17 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 0BV4OChJ009252 Received: from [10.0.0.213] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8A65F1E965; Wed, 30 Dec 2020 23:24:12 -0500 (EST) Subject: Re: [PATCH 2/4] Return true in TuiWindow.is_valid only if TUI is enabled To: Hannes Domani , gdb-patches@sourceware.org, Tom Tromey References: <20201229170227.821-1-ssbssa@yahoo.de> <20201229170227.821-2-ssbssa@yahoo.de> From: Simon Marchi Message-ID: <9da77c9f-3256-7eb4-dad9-f1525abeba81@polymtl.ca> Date: Wed, 30 Dec 2020 23:24:12 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20201229170227.821-2-ssbssa@yahoo.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 31 Dec 2020 04:24:12 +0000 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2020 04:24:19 -0000 On 2020-12-29 12:02 p.m., Hannes Domani via Gdb-patches wrote: > There seems to be no other way to determine if TUI is enabled, which is a > problem in case the TUI is disabled, and you redraw the window contents > based on some registered event. > Then the TUI is redrawn, even though the TUI stays disabled, and the prompt > is anywhere on the screen. > > gdb/ChangeLog: > > 2020-12-29 Hannes Domani > > * python/py-tui.c (gdbpy_tui_is_valid): Check tui_active as well. > --- > gdb/python/py-tui.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c > index 87065eaf60..9c35778bcb 100644 > --- a/gdb/python/py-tui.c > +++ b/gdb/python/py-tui.c > @@ -356,7 +356,7 @@ gdbpy_tui_is_valid (PyObject *self, PyObject *args) > { > gdbpy_tui_window *win = (gdbpy_tui_window *) self; > > - if (win->window != nullptr) > + if (tui_active && win->window != nullptr) > Py_RETURN_TRUE; > Py_RETURN_FALSE; > } > I think that makes sense, although I'd like Tom to confirm. Simon