]> code.delx.au - gnu-emacs/commitdiff
Ignore fullscreen exit notifications on NS when frame is dead
authorDavid Reitter <david.reitter@gmail.com>
Sat, 7 Nov 2015 13:32:59 +0000 (08:32 -0500)
committerDavid Reitter <david.reitter@gmail.com>
Sat, 7 Nov 2015 13:40:13 +0000 (08:40 -0500)
* nsterm.m (windowDidResize:,windowWillExitFullScreen:)
  (windowDidExitFullScreen:): Return if frame is dead.
  These functions may be called when a fullscreen frame
  is closed; they are called before, not after.

May address Bug#21428.

src/nsterm.m

index b4ec553d7ee52c5f6acf08819acec64e388e028e..9a2249c57bb7aff8a46c39dec9e6c1dcc8ca8ba6 100644 (file)
@@ -6380,7 +6380,11 @@ not_in_argv (NSString *arg)
 - (void)windowDidResize: (NSNotification *)notification
 {
   NSTRACE ("windowDidResize");
-
+  if (!FRAME_LIVE_P (emacsframe))
+    {
+      NSTRACE_MSG ("Ignored (frame dead)");
+      return;
+    }
   if (emacsframe->output_data.ns->in_animation)
     {
       NSTRACE_MSG ("Ignored (in animation)");
@@ -6902,7 +6906,11 @@ not_in_argv (NSString *arg)
 - (void)windowWillExitFullScreen:(NSNotification *)notification
 {
   NSTRACE ("windowWillExitFullScreen");
-
+  if (!FRAME_LIVE_P (emacsframe))
+    {
+      NSTRACE_MSG ("Ignored (frame dead)");
+      return;
+    }
   if (next_maximized != -1)
     fs_before_fs = next_maximized;
 }
@@ -6910,7 +6918,11 @@ not_in_argv (NSString *arg)
 - (void)windowDidExitFullScreen:(NSNotification *)notification
 {
   NSTRACE ("windowDidExitFullScreen");
-
+  if (!FRAME_LIVE_P (emacsframe))
+    {
+      NSTRACE_MSG ("Ignored (frame dead)");
+      return;
+    }
   [self setFSValue: fs_before_fs];
   fs_before_fs = -1;
 #ifdef HAVE_NATIVE_FS