diff options
| author | Gerd Möllmann | 2025-01-25 19:42:52 +0100 |
|---|---|---|
| committer | Gerd Möllmann | 2025-01-25 20:00:56 +0100 |
| commit | 85aec497c71e26b66ecfc85c20d7888336300e1f (patch) | |
| tree | 6f8802d92ddbba4528728663356357f42ecc0e0e /src | |
| parent | 63df2164903e0cd6819187483a64b892aa7e0219 (diff) | |
| download | emacs-85aec497c71e26b66ecfc85c20d7888336300e1f.tar.gz emacs-85aec497c71e26b66ecfc85c20d7888336300e1f.zip | |
Replace is_frame_ancestor with frame_ancestor_p
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 1 | ||||
| -rw-r--r-- | src/dispnew.c | 17 | ||||
| -rw-r--r-- | src/term.c | 2 |
3 files changed, 4 insertions, 16 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index e1214128e35..1b383164752 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3960,7 +3960,6 @@ void tty_raise_lower_frame (struct frame *f, bool raise); | |||
| 3960 | int max_child_z_order (struct frame *parent); | 3960 | int max_child_z_order (struct frame *parent); |
| 3961 | void root_xy (struct frame *f, int x, int y, int *rx, int *ry); | 3961 | void root_xy (struct frame *f, int x, int y, int *rx, int *ry); |
| 3962 | void child_xy (struct frame *f, int x, int y, int *cx, int *cy); | 3962 | void child_xy (struct frame *f, int x, int y, int *cx, int *cy); |
| 3963 | bool is_frame_ancestor (struct frame *f1, struct frame *f2); | ||
| 3964 | 3963 | ||
| 3965 | INLINE_HEADER_END | 3964 | INLINE_HEADER_END |
| 3966 | 3965 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index bc37230d70c..d28dc3d54fa 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -3366,17 +3366,6 @@ max_child_z_order (struct frame *parent) | |||
| 3366 | return z_order; | 3366 | return z_order; |
| 3367 | } | 3367 | } |
| 3368 | 3368 | ||
| 3369 | /* Return true if F1 is an ancestor of F2. */ | ||
| 3370 | |||
| 3371 | bool | ||
| 3372 | is_frame_ancestor (struct frame *f1, struct frame *f2) | ||
| 3373 | { | ||
| 3374 | for (struct frame *f = FRAME_PARENT_FRAME (f2); f; f = FRAME_PARENT_FRAME (f)) | ||
| 3375 | if (f == f1) | ||
| 3376 | return true; | ||
| 3377 | return false; | ||
| 3378 | } | ||
| 3379 | |||
| 3380 | /* Return a list of all frames having root frame ROOT. | 3369 | /* Return a list of all frames having root frame ROOT. |
| 3381 | If VISIBLE_ONLY is true, return only visible frames. */ | 3370 | If VISIBLE_ONLY is true, return only visible frames. */ |
| 3382 | 3371 | ||
| @@ -3420,9 +3409,9 @@ frame_z_order_cmp (struct frame *f1, struct frame *f2) | |||
| 3420 | { | 3409 | { |
| 3421 | if (f1 == f2) | 3410 | if (f1 == f2) |
| 3422 | return 0; | 3411 | return 0; |
| 3423 | if (is_frame_ancestor (f1, f2)) | 3412 | if (frame_ancestor_p (f1, f2)) |
| 3424 | return -1; | 3413 | return -1; |
| 3425 | if (is_frame_ancestor (f2, f1)) | 3414 | if (frame_ancestor_p (f2, f1)) |
| 3426 | return 1; | 3415 | return 1; |
| 3427 | return f1->z_order - f2->z_order; | 3416 | return f1->z_order - f2->z_order; |
| 3428 | } | 3417 | } |
| @@ -3704,7 +3693,7 @@ static void | |||
| 3704 | copy_child_glyphs (struct frame *root, struct frame *child) | 3693 | copy_child_glyphs (struct frame *root, struct frame *child) |
| 3705 | { | 3694 | { |
| 3706 | eassert (!FRAME_PARENT_FRAME (root)); | 3695 | eassert (!FRAME_PARENT_FRAME (root)); |
| 3707 | eassert (is_frame_ancestor (root, child)); | 3696 | eassert (frame_ancestor_p (root, child)); |
| 3708 | 3697 | ||
| 3709 | /* Determine the intersection of the child frame rectangle with the | 3698 | /* Determine the intersection of the child frame rectangle with the |
| 3710 | root frame. This is basically clipping the child frame to the | 3699 | root frame. This is basically clipping the child frame to the |
diff --git a/src/term.c b/src/term.c index 1b2e44af8db..777ab5f918c 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -3004,7 +3004,7 @@ mouse_get_xy (int *x, int *y) | |||
| 3004 | 3004 | ||
| 3005 | struct frame *f = XFRAME (XCAR (mouse)); | 3005 | struct frame *f = XFRAME (XCAR (mouse)); |
| 3006 | struct frame *sf = SELECTED_FRAME (); | 3006 | struct frame *sf = SELECTED_FRAME (); |
| 3007 | if (f == sf || is_frame_ancestor (sf, f)) | 3007 | if (f == sf || frame_ancestor_p (sf, f)) |
| 3008 | { | 3008 | { |
| 3009 | int mx = XFIXNUM (XCAR (XCDR (mouse))); | 3009 | int mx = XFIXNUM (XCAR (XCDR (mouse))); |
| 3010 | int my = XFIXNUM (XCDR (XCDR (mouse))); | 3010 | int my = XFIXNUM (XCDR (XCDR (mouse))); |