all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: John Mastro <john.b.mastro@gmail.com>
Cc: 28661@debbugs.gnu.org, Kevin Lin <lin.kevin.k@gmail.com>
Subject: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High Sierra causes crash
Date: Sat, 7 Oct 2017 16:08:23 +0100	[thread overview]
Message-ID: <20171007150823.GA62951@breton.holly.idiocy.org> (raw)
In-Reply-To: <CAOj2CQRfoGgkMtzGTskTbPB05bLW5gOku2gX-n4N0twiDTTbRg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

On Wed, Oct 04, 2017 at 05:44:13PM -0700, John Mastro wrote:
> Alan Third <alan@idiocy.org> wrote:
> > I guess that closing a fullscreen window now results in it being
> > resized. But is emacsframe already trashed by this point? That would
> > certainly cause a crash.
> >
> > Can you please uncomment line 54 in nsterm.h to enable NSTRACE,
> > recompile, cause the crash and send the output to me?
> 
> I've done so and the trace is attached.

Thank you!

It looks like it is trying to resize the frame after we’ve already
cleaned it up. Do fullscreen windows animate when they close on 10.13?

Anyway, I’ve attached a patch, can you give it a go and see if it
works?
-- 
Alan Third

[-- Attachment #2: 0001-Fix-crash-when-closing-fullscreen-frame-on-macOS-bug.patch --]
[-- Type: text/plain, Size: 915 bytes --]

From c544ffbf0ed005729f40d358a39cbf01b3577795 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 7 Oct 2017 16:00:49 +0100
Subject: [PATCH] Fix crash when closing fullscreen frame on macOS (bug#28661)

* src/nsterm.m (EmacsView::windowWillResize): Return new frame size
unmodified if the frame isn't live.
---
 src/nsterm.m | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/nsterm.m b/src/nsterm.m
index f0b6a70dae..abfdffc9f5 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6893,6 +6893,9 @@ - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
   NSTRACE_RECT   ("[sender frame]", [sender frame]);
   NSTRACE_FSTYPE ("fs_state", fs_state);
 
+  if (!FRAME_LIVE_P (emacsframe))
+    return frameSize;
+
   if (fs_state == FULLSCREEN_MAXIMIZED
       && (maximized_width != (int)frameSize.width
           || maximized_height != (int)frameSize.height))
-- 
2.14.1


  reply	other threads:[~2017-10-07 15:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-01 15:43 bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High Sierra causes crash Kevin Lin
2017-10-01 19:33 ` Alan Third
2017-10-01 22:07   ` Kevin Lin
2017-10-01 22:56   ` John Mastro
2017-10-01 23:01     ` Alan Third
2017-10-02 21:27       ` John Mastro
2017-10-02 22:34         ` Alan Third
2017-10-05  0:44           ` John Mastro
2017-10-07 15:08             ` Alan Third [this message]
2017-10-07 17:46               ` John Mastro
2017-10-07 20:56                 ` Alan Third
2017-10-07 22:50                   ` Kevin Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171007150823.GA62951@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=28661@debbugs.gnu.org \
    --cc=john.b.mastro@gmail.com \
    --cc=lin.kevin.k@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.