unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: "Kirill A. Korinsky" <kirill@korins.ky>
Cc: 50534@debbugs.gnu.org
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	[thread overview]
Message-ID: <YT/d6g7Uxcw/zab2@idiocy.org> (raw)
In-Reply-To: <BC298DB6-BB39-46DB-ACF2-DF742739C951@korins.ky>

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

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

[-- Attachment #2: v4-0001-Fix-incorrectly-appearing-toolbar-on-NS-bug-50534.patch --]
[-- Type: text/x-diff, Size: 1612 bytes --]

From 86f1c66b9237bd9cb094d3b77aa0907114c2f2dc Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
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


  reply	other threads:[~2021-09-13 23:25 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12  0:29 bug#50534: 28.0.50; Toolbar shows despite tool-bar-mode being disabled on macOS Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.50534.B.16314065846903.ack@debbugs.gnu.org>
2021-09-12  9:25   ` bug#50534: Acknowledgement (28.0.50; Toolbar shows despite tool-bar-mode being disabled on macOS) Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-12 11:48 ` bug#50534: 28.0.50; Toolbar shows despite tool-bar-mode being disabled on macOS Alan Third
2021-09-12 12:54   ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-12 15:33     ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-12 15:44     ` Alan Third
2021-09-12 16:40       ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-12 19:43         ` Alan Third
2021-09-12 19:52           ` Alan Third
2021-09-12 20:14             ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-12 20:35               ` Alan Third
2021-09-12 21:02                 ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-13 18:44                   ` Alan Third
2021-09-13 18:52                     ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-13 18:54                       ` Alan Third
2021-09-13 18:57                         ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-13 19:11                           ` Alan Third
2021-09-13 20:42                             ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-13 22:21                               ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-13 23:25                                 ` Alan Third [this message]
2021-09-14  0:05                                   ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-14  9:21                                     ` Alan Third
2021-09-14 11:26                                       ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-14 12:13                                         ` Alan Third
2021-09-14 12:54                                           ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-14 14:17                                           ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-14 14:35                                             ` Alan Third
2021-09-14 14:43                                               ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-17 17:26                                               ` Alan Third
2021-09-26 10:56                                                 ` Alan Third
2021-09-26 16:23                                                   ` Mattias Engdegård
2021-09-27 10:10                                                     ` Alan Third
2021-09-28 19:00                                                       ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-28 19:14                                                         ` Alan Third
2021-09-29 10:53                                                           ` Kirill A. Korinsky via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-14 16:07                                         ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YT/d6g7Uxcw/zab2@idiocy.org \
    --to=alan@idiocy.org \
    --cc=50534@debbugs.gnu.org \
    --cc=kirill@korins.ky \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).