From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#50534: 28.0.50; Toolbar shows despite tool-bar-mode being disabled on macOS Date: Tue, 14 Sep 2021 00:25:30 +0100 Message-ID: References: <1F1BB95A-CCD9-4602-9CBB-0539D311B438@korins.ky> <63382A54-A99A-45DD-9527-F1DF742ABEEB@korins.ky> <43E37DDD-8314-4A12-8111-A7C48F625BD7@korins.ky> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TxccJ8Tr594aMvio" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3163"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50534@debbugs.gnu.org To: "Kirill A. Korinsky" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 14 01:26:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mPvL0-0000eU-5N for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Sep 2021 01:26:10 +0200 Original-Received: from localhost ([::1]:39986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPvKy-000395-Rr for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Sep 2021 19:26:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPvKs-00038i-ES for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 19:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPvKs-0000I4-7A for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 19:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPvKs-0004rn-2l for bug-gnu-emacs@gnu.org; Mon, 13 Sep 2021 19:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Sep 2021 23:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50534 X-GNU-PR-Package: emacs Original-Received: via spool by 50534-submit@debbugs.gnu.org id=B50534.163157554218676 (code B ref 50534); Mon, 13 Sep 2021 23:26:02 +0000 Original-Received: (at 50534) by debbugs.gnu.org; 13 Sep 2021 23:25:42 +0000 Original-Received: from localhost ([127.0.0.1]:47060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPvKY-0004rA-AK for submit@debbugs.gnu.org; Mon, 13 Sep 2021 19:25:42 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:39183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPvKW-0004qt-5z for 50534@debbugs.gnu.org; Mon, 13 Sep 2021 19:25:41 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 13F3447; Mon, 13 Sep 2021 23:25:34 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1631575533; bh=VspPzw6nwmZNhH/V1/2bW6FQhfAPTx0rniUCca3IzzM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e56tIXenGmbtFedR5eEYpnTPwSbn7fCaF542H4ZjB4eWm+uGgEhsBYgV0Q1RJnmh1 57hbKNsNoktWzUOS+5/EN/0ZAUuaE5NZOb3rHg7VCQ3XMUw+hcxOuOsDobp7AitG21 rXM71qZhB+L+5t3srM57CXwkUWqWTPc3XLPKORs94XnDbopL/aGmg/RTQVFNFwQ7g0 sy1TiBGRuIJ1uHTojKXaPiubLbD6TweNLBoY9kap8lcWGK3mstsY2zWDIZtrvOGXRF 0gxxUESUsmDUOw67luxIvM3D2Ea88VJSQ8IsymLY6LXyxgLhxYuC2D6dx6ua8VHsjt IFVAry2aNKcuQ== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1mPvKM-001sxT-4q; Tue, 14 Sep 2021 00:25:30 +0100 Mail-Followup-To: Alan Third , "Kirill A. Korinsky" , 50534@debbugs.gnu.org Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214270 Archived-At: --TxccJ8Tr594aMvio Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 14, 2021 at 12:21:27AM +0200, Kirill A. Korinsky wrote: > Maybe it can be for some use. > > I've attached the minimal patch which fixed issue for me. > > This patch reverted some of your changes. > > Because when I move to full screen => toolbar is dissapear, I feel that the root cause is replacing layoutSublayersOfLayer to layout. > > Anyway, I don't know quartz and I can't minimize it future. It has to be a timing issue. None of the code you're changing touches the toolbar or its visibility, directly or indirectly, so any change there can only be altering when various pieces of code are called. Changing to and from fullscreen explicitly resets the toolbar's visibility. I think what we probably want to do is default the toolbar to non-visible when it's created (at the moment it's using the default, which I suspect is visible), and then rely on the fact that update_frame_tool_bar is always called when it should be visible to turn it back on. Patch attached. -- Alan Third --TxccJ8Tr594aMvio Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v4-0001-Fix-incorrectly-appearing-toolbar-on-NS-bug-50534.patch" >From 86f1c66b9237bd9cb094d3b77aa0907114c2f2dc Mon Sep 17 00:00:00 2001 From: Alan Third Date: Mon, 13 Sep 2021 20:09:22 +0100 Subject: [PATCH v4] Fix incorrectly appearing toolbar on NS (bug#50534) * src/nsmenu.m (update_frame_tool_bar): Ensure both sides of the test are booleans. * src/nsterm.m ([EmacsWindow createToolbar:]): Make the toolbar non-visible initially, in case things get out of sync. Remove call to update_frame_tool_bar: the window isn't yet associated with the view, so it will return immediately. --- src/nsmenu.m | 2 +- src/nsterm.m | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/nsmenu.m b/src/nsmenu.m index 0d0b2f60c9..947c8368ed 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1090,7 +1090,7 @@ - (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item #undef TOOLPROP } - if ([toolbar isVisible] != FRAME_EXTERNAL_TOOL_BAR (f)) + if (![toolbar isVisible] != !FRAME_EXTERNAL_TOOL_BAR (f)) { f->output_data.ns->in_animation = 1; [toolbar setVisible: FRAME_EXTERNAL_TOOL_BAR (f)]; diff --git a/src/nsterm.m b/src/nsterm.m index f8b8c1e574..33850544b0 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8253,10 +8253,9 @@ - (void)createToolbar: (struct frame *)f EmacsToolbar *toolbar = [[EmacsToolbar alloc] initForView:view withIdentifier:[NSString stringWithLispString:f->name]]; + [toolbar setVisible:NO]; [self setToolbar:toolbar]; - update_frame_tool_bar (f); - #ifdef NS_IMPL_COCOA { NSButton *toggleButton; -- 2.30.2 --TxccJ8Tr594aMvio--