From: Alan Third Date: Sat, 22 Apr 2017 09:42:35 +0000 (+0100) Subject: Fix GNUstep build X-Git-Tag: emacs-26.0.90~521^2~579 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=401e41df0c6aee6c071a26e0b89f16c70375fc2d;p=emacs.git Fix GNUstep build * src/nsfns.m (Fns_frame_z_list_order): Rewrite for GNUstep compatibility. * src/nsmenu.m (update_frame_tool_bar): Remove unused variable. --- diff --git a/src/nsfns.m b/src/nsfns.m index 3a37df95759..cbe0ffb8580 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1456,27 +1456,24 @@ return the child frames of that frame in Z (stacking) order. Frames are listed from topmost (first) to bottommost (last). */) (Lisp_Object terminal) { - NSArray *list = [NSApp orderedWindows]; Lisp_Object frames = Qnil; + NSWindow *parent = nil; if (FRAMEP (terminal) && FRAME_LIVE_P (XFRAME (terminal))) - { - /* Filter LIST to just those that are ancestors of TERMINAL. */ - NSWindow *win = [FRAME_NS_VIEW (XFRAME (terminal)) window]; - - NSPredicate *ancestor_pred = - [NSPredicate predicateWithBlock:^BOOL(id candidate, NSDictionary *bind) { - return ns_window_is_ancestor (win, [(NSWindow *)candidate parentWindow]); - }]; - - list = [[NSApp orderedWindows] filteredArrayUsingPredicate: ancestor_pred]; - } + parent = [FRAME_NS_VIEW (XFRAME (terminal)) window]; + else if (!NILP (terminal)) + return Qnil; - for (NSWindow *win in [list reverseObjectEnumerator]) + for (NSWindow *win in [[NSApp orderedWindows] reverseObjectEnumerator]) { Lisp_Object frame; - XSETFRAME (frame, ((EmacsView *)[win delegate])->emacsframe); - frames = Fcons(frame, frames); + + /* Check against [win parentWindow] so that it doesn't match itself. */ + if (parent == nil || ns_window_is_ancestor (parent, [win parentWindow])) + { + XSETFRAME (frame, ((EmacsView *)[win delegate])->emacsframe); + frames = Fcons(frame, frames); + } } return frames; diff --git a/src/nsmenu.m b/src/nsmenu.m index 1262c9cb4d6..8dc6ea1d344 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1012,7 +1012,6 @@ update_frame_tool_bar (struct frame *f) { int i, k = 0; EmacsView *view = FRAME_NS_VIEW (f); - NSWindow *window = [view window]; EmacsToolbar *toolbar = [view toolbar]; int oldh;