emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b0fe06e: Disable the NS app when no frames are left (bug#14619, b


From: Alan Third
Subject: master b0fe06e: Disable the NS app when no frames are left (bug#14619, bug#21357, bug#23586)
Date: Sun, 29 Aug 2021 05:23:14 -0400 (EDT)

branch: master
commit b0fe06e656209581466f60ac3b9ea98bb6acecbf
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>

    Disable the NS app when no frames are left (bug#14619, bug#21357, bug#23586)
    
    * src/nsfns.m (Fx_create_frame): Enable the app.
    * src/nsterm.m (ns_delete_terminal): Disable the app.
---
 src/nsfns.m  | 5 +++++
 src/nsterm.m | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/src/nsfns.m b/src/nsfns.m
index c403677..07bcab1 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -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);
diff --git a/src/nsterm.m b/src/nsterm.m
index 1c1f0c8..4bdc67c 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -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 ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]