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