aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Third2021-08-25 21:00:07 +0100
committerAlan Third2021-08-29 10:22:15 +0100
commitb0fe06e656209581466f60ac3b9ea98bb6acecbf (patch)
tree7b58950a5f94b4e88e10de4e180f865908388fb0 /src
parent8fb32387c1c9370cb53635b8ff94e4aa90d034f7 (diff)
downloademacs-b0fe06e656209581466f60ac3b9ea98bb6acecbf.tar.gz
emacs-b0fe06e656209581466f60ac3b9ea98bb6acecbf.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nsfns.m5
-rw-r--r--src/nsterm.m6
2 files changed, 11 insertions, 0 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index c40367703db..07bcab1816b 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1343,6 +1343,11 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1343 1343
1344 f->output_data.ns->in_animation = NO; 1344 f->output_data.ns->in_animation = NO;
1345 1345
1346#ifdef NS_IMPL_COCOA
1347 /* If the app has previously been disabled, start it up again. */
1348 [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
1349#endif
1350
1346 [[EmacsView alloc] initFrameFromEmacs: f]; 1351 [[EmacsView alloc] initFrameFromEmacs: f];
1347 1352
1348 ns_icon (f, parms); 1353 ns_icon (f, parms);
diff --git a/src/nsterm.m b/src/nsterm.m
index 1c1f0c8f239..4bdc67c10b5 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5014,6 +5014,12 @@ ns_delete_terminal (struct terminal *terminal)
5014 5014
5015 block_input (); 5015 block_input ();
5016 5016
5017#ifdef NS_IMPL_COCOA
5018 /* Rather than try to clean up the NS environment we can just
5019 disable the app and leave it waiting for any new frames. */
5020 [NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
5021#endif
5022
5017 image_destroy_all_bitmaps (dpyinfo); 5023 image_destroy_all_bitmaps (dpyinfo);
5018 ns_delete_display (dpyinfo); 5024 ns_delete_display (dpyinfo);
5019 unblock_input (); 5025 unblock_input ();