From: Alan Third Date: Wed, 23 Jun 2021 15:07:12 +0000 (+0100) Subject: Fix some macOS problems X-Git-Tag: emacs-28.0.90~1631 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=12c5ca4d825496b3c7304b75ab82a6fabdc2023d;p=emacs.git Fix some macOS problems * src/nsmenu.m (update_frame_tool_bar): Make sure the toolbar isn't displayed when it's not supposed to be. * src/nsterm.m ([EmacsView layoutSublayersOfLayer:]): Reinstate code intended to prevent a crash when running redisplay. --- diff --git a/src/nsmenu.m b/src/nsmenu.m index 673c0423d04..bb0dd2634d8 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1089,10 +1089,10 @@ update_frame_tool_bar (struct frame *f) #undef TOOLPROP } - if (![toolbar isVisible]) + if ([toolbar isVisible] != FRAME_EXTERNAL_TOOL_BAR (f)) { f->output_data.ns->in_animation = 1; - [toolbar setVisible: YES]; + [toolbar setVisible: FRAME_EXTERNAL_TOOL_BAR (f)]; f->output_data.ns->in_animation = 0; } diff --git a/src/nsterm.m b/src/nsterm.m index 29a86e41484..3676418c9b9 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7945,20 +7945,15 @@ not_in_argv (NSString *arg) crashes. I think it's because this code will always be run within the run loop and for whatever reason processing input is dangerous. This technique was stolen wholesale from - nsmenu.m and seems to work. - - FIXME: I can't provoke a crash using layoutSublayersOfLayer, - however I can't understand why it would be different from - viewWillDraw. I'll leave this commented out for now, but if - nobody reports a crash it can be removed. */ - // bool owfi = waiting_for_input; - // waiting_for_input = 0; - // block_input (); + nsmenu.m and seems to work. */ + bool owfi = waiting_for_input; + waiting_for_input = 0; + block_input (); redisplay (); - // unblock_input (); - // waiting_for_input = owfi; + unblock_input (); + waiting_for_input = owfi; } } #endif