]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable the NS app when no frames are left (bug#14619, bug#21357, bug#23586)
authorAlan Third <alan@idiocy.org>
Wed, 25 Aug 2021 20:00:07 +0000 (21:00 +0100)
committerAlan Third <alan@idiocy.org>
Sun, 29 Aug 2021 09:22:15 +0000 (10:22 +0100)
* src/nsfns.m (Fx_create_frame): Enable the app.
* src/nsterm.m (ns_delete_terminal): Disable the app.

src/nsfns.m
src/nsterm.m

index c40367703dbbc67e72f6a33493c3c199c1a51a63..07bcab1816beb640579c5ba03a71cd6f2a389f81 100644 (file)
@@ -1343,6 +1343,11 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
 
   f->output_data.ns->in_animation = NO;
 
+#ifdef NS_IMPL_COCOA
+  /* If the app has previously been disabled, start it up again.  */
+  [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
+#endif
+
   [[EmacsView alloc] initFrameFromEmacs: f];
 
   ns_icon (f, parms);
index 1c1f0c8f239b3bc6d15cd743fd426928e7a5f603..4bdc67c10b5dc3708f2ed0e4f619bf23e63f5aa7 100644 (file)
@@ -5014,6 +5014,12 @@ ns_delete_terminal (struct terminal *terminal)
 
   block_input ();
 
+#ifdef NS_IMPL_COCOA
+  /* Rather than try to clean up the NS environment we can just
+     disable the app and leave it waiting for any new frames.  */
+  [NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
+#endif
+
   image_destroy_all_bitmaps (dpyinfo);
   ns_delete_display (dpyinfo);
   unblock_input ();