]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix GNUstep build
authorAlan Third <alan@idiocy.org>
Sat, 22 Apr 2017 09:42:35 +0000 (10:42 +0100)
committerAlan Third <alan@idiocy.org>
Sat, 22 Apr 2017 09:42:35 +0000 (10:42 +0100)
* src/nsfns.m (Fns_frame_z_list_order): Rewrite for GNUstep
compatibility.
* src/nsmenu.m (update_frame_tool_bar): Remove unused variable.

src/nsfns.m
src/nsmenu.m

index 3a37df95759891c769f098bc77ee3ff10a3f924d..cbe0ffb85804d424fecdc2f87ba83e4746fd4a27 100644 (file)
@@ -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;
index 1262c9cb4d6315cebef37b84134f0aec2bfb7af6..8dc6ea1d344fb119d9adc46e83c93a6f77e4a656 100644 (file)
@@ -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;