From: Alan Third Date: Sun, 6 May 2018 20:49:31 +0000 (+0100) Subject: Check NSWindow is actually a frame X-Git-Tag: emacs-26.1~41 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7dc028e;p=emacs.git Check NSWindow is actually a frame * src/nsfns.m (Fns_frame_list_z_order): Check NSWindow is an instance of EmacsView before treating it as one. --- diff --git a/src/nsfns.m b/src/nsfns.m index 7f2f060dda8..bd1e2283a0c 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1497,7 +1497,8 @@ Frames are listed from topmost (first) to bottommost (last). */) Lisp_Object frame; /* Check against [win parentWindow] so that it doesn't match itself. */ - if (parent == nil || ns_window_is_ancestor (parent, [win parentWindow])) + if ([[win delegate] isKindOfClass:[EmacsView class]] + && (parent == nil || ns_window_is_ancestor (parent, [win parentWindow]))) { XSETFRAME (frame, ((EmacsView *)[win delegate])->emacsframe); frames = Fcons(frame, frames);