]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace is_frame_ancestor with frame_ancestor_p
authorGerd Möllmann <gerd@gnu.org>
Sat, 25 Jan 2025 18:42:52 +0000 (19:42 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 26 Jan 2025 18:53:30 +0000 (19:53 +0100)
* src/dispnew.c (is_frame_ancestor): Removed.
(frame_z_order_cmp): Use frame_ancestor_p.
(copy_child_glyphs): Ditto.
* src/dispextern.h: Declaration removed.
* src/term.c (mouse_get_xy): Use frame_ancestor_p.

(cherry picked from commit 85aec497c71e26b66ecfc85c20d7888336300e1f)

src/dispextern.h
src/dispnew.c
src/term.c

index e1214128e358c9f23f074db70a67f546a7e7cd42..1b3831647521919ef58ebfaa3d47b113f24b6238 100644 (file)
@@ -3960,7 +3960,6 @@ void tty_raise_lower_frame (struct frame *f, bool raise);
 int max_child_z_order (struct frame *parent);
 void root_xy (struct frame *f, int x, int y, int *rx, int *ry);
 void child_xy (struct frame *f, int x, int y, int *cx, int *cy);
-bool is_frame_ancestor (struct frame *f1, struct frame *f2);
 
 INLINE_HEADER_END
 
index ac1805a44898f6b486a2ec573ca04ffdd4e64f55..25a1e9701f218c915795cae7b9229f92b8cabd0b 100644 (file)
@@ -3363,17 +3363,6 @@ max_child_z_order (struct frame *parent)
   return z_order;
 }
 
-/* Return true if F1 is an ancestor of F2.  */
-
-bool
-is_frame_ancestor (struct frame *f1, struct frame *f2)
-{
-  for (struct frame *f = FRAME_PARENT_FRAME (f2); f; f = FRAME_PARENT_FRAME (f))
-    if (f == f1)
-      return true;
-  return false;
-}
-
 /* Return a list of all frames having root frame ROOT.
    If VISIBLE_ONLY is true, return only visible frames.  */
 
@@ -3417,9 +3406,9 @@ frame_z_order_cmp (struct frame *f1, struct frame *f2)
 {
   if (f1 == f2)
     return 0;
-  if (is_frame_ancestor (f1, f2))
+  if (frame_ancestor_p (f1, f2))
     return -1;
-  if (is_frame_ancestor (f2, f1))
+  if (frame_ancestor_p (f2, f1))
     return 1;
   return f1->z_order - f2->z_order;
 }
@@ -3701,7 +3690,7 @@ static void
 copy_child_glyphs (struct frame *root, struct frame *child)
 {
   eassert (!FRAME_PARENT_FRAME (root));
-  eassert (is_frame_ancestor (root, child));
+  eassert (frame_ancestor_p (root, child));
 
   /* Determine the intersection of the child frame rectangle with the
      root frame.  This is basically clipping the child frame to the
index 1b2e44af8db2d6a4b233ff6deab0a9019f858e0e..777ab5f918c7e8e27d946fe0d9b5f864456d8564 100644 (file)
@@ -3004,7 +3004,7 @@ mouse_get_xy (int *x, int *y)
 
   struct frame *f = XFRAME (XCAR (mouse));
   struct frame *sf = SELECTED_FRAME ();
-  if (f == sf || is_frame_ancestor (sf, f))
+  if (f == sf || frame_ancestor_p (sf, f))
     {
       int mx = XFIXNUM (XCAR (XCDR (mouse)));
       int my = XFIXNUM (XCDR (XCDR (mouse)));