From 1e83d04214f27a79a4d4841772da946e24cbf21d Mon Sep 17 00:00:00 2001 From: Alan Third Date: Mon, 13 Sep 2021 20:09:22 +0100 Subject: [PATCH] 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 3493e4e131d..f0c5bb24e63 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1094,7 +1094,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 8d88f7bd3de..7c90bbd5787 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8323,10 +8323,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;