]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix some macOS problems
authorAlan Third <alan@idiocy.org>
Wed, 23 Jun 2021 15:07:12 +0000 (16:07 +0100)
committerAlan Third <alan@idiocy.org>
Sat, 31 Jul 2021 10:13:05 +0000 (11:13 +0100)
* 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.

src/nsmenu.m
src/nsterm.m

index 673c0423d047f60cf1b66067d85163617982468a..bb0dd2634d8eba781cbf71d3da7045b24a37756b 100644 (file)
@@ -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;
     }
 
index 29a86e41484bda54643e9ae233a694cd588820ff..3676418c9b9e054451b5f35c1cbed8ccd6966a3d 100644 (file)
@@ -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