aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h2
-rw-r--r--src/dispnew.c4
-rw-r--r--src/term.c17
3 files changed, 11 insertions, 12 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index af4e0547af4..3582b9d567d 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3967,6 +3967,8 @@ void check_window_matrix_pointers_for_frame (struct frame *f);
3967# else 3967# else
3968INLINE void check_window_matrix_pointers_for_frame (struct frame *f) {} 3968INLINE void check_window_matrix_pointers_for_frame (struct frame *f) {}
3969# endif 3969# endif
3970void frame_pos_abs (struct frame *f, int *x, int *y);
3971bool is_frame_ancestor (struct frame *f1, struct frame *f2);
3970 3972
3971INLINE_HEADER_END 3973INLINE_HEADER_END
3972 3974
diff --git a/src/dispnew.c b/src/dispnew.c
index a35ded7e567..93cf40b0203 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3383,7 +3383,7 @@ rect_intersect (struct rect *r, struct rect r1, struct rect r2)
3383 3383
3384/* Return the absolute position of frame F in *X and *Y. */ 3384/* Return the absolute position of frame F in *X and *Y. */
3385 3385
3386static void 3386void
3387frame_pos_abs (struct frame *f, int *x, int *y) 3387frame_pos_abs (struct frame *f, int *x, int *y)
3388{ 3388{
3389 *x = *y = 0; 3389 *x = *y = 0;
@@ -3423,7 +3423,7 @@ max_child_z_order (struct frame *parent)
3423 3423
3424/* Return true if F1 is an ancestor of F2. */ 3424/* Return true if F1 is an ancestor of F2. */
3425 3425
3426static bool 3426bool
3427is_frame_ancestor (struct frame *f1, struct frame *f2) 3427is_frame_ancestor (struct frame *f1, struct frame *f2)
3428{ 3428{
3429 for (struct frame *f = FRAME_PARENT_FRAME (f2); f; f = FRAME_PARENT_FRAME (f)) 3429 for (struct frame *f = FRAME_PARENT_FRAME (f2); f; f = FRAME_PARENT_FRAME (f))
diff --git a/src/term.c b/src/term.c
index 47fd9297ab5..4774b7a32d0 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2990,19 +2990,16 @@ tty_menu_calc_size (tty_menu *menu, int *width, int *height)
2990static void 2990static void
2991mouse_get_xy (int *x, int *y) 2991mouse_get_xy (int *x, int *y)
2992{ 2992{
2993 Lisp_Object lmx = Qnil, lmy = Qnil;
2994 Lisp_Object mouse = mouse_position (tty_menu_calls_mouse_position_function); 2993 Lisp_Object mouse = mouse_position (tty_menu_calls_mouse_position_function);
2995 2994
2996 if (EQ (selected_frame, XCAR (mouse))) 2995 struct frame *f = XFRAME (XCAR (mouse));
2997 { 2996 struct frame *sf = SELECTED_FRAME ();
2998 lmx = XCAR (XCDR (mouse)); 2997 if (f == sf || is_frame_ancestor (sf, f))
2999 lmy = XCDR (XCDR (mouse));
3000 }
3001
3002 if (!NILP (lmx))
3003 { 2998 {
3004 *x = XFIXNUM (lmx); 2999 int fx, fy;
3005 *y = XFIXNUM (lmy); 3000 frame_pos_abs (f, &fx, &fy);
3001 *x = fx + XFIXNUM (XCAR (XCDR (mouse)));
3002 *y = fy + XFIXNUM (XCDR (XCDR (mouse)));
3006 } 3003 }
3007} 3004}
3008 3005