void combine_updates_for_frame (struct frame *f, bool inhibit_id_p);
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 frame_pos_abs (struct frame *f, int *x, int *y);
bool is_frame_ancestor (struct frame *f1, struct frame *f2);
INLINE_HEADER_END
return true;
}
-/* Translate (X, Y) relative to frame F to absolute coordinates
- in (*X, *Y). */
+/* Return the absolute position of frame F in *X and *Y. */
void
-root_xy (struct frame *f, int x, int y, int *rx, int *ry)
+frame_pos_abs (struct frame *f, int *x, int *y)
{
- *rx = x;
- *ry = y;
+ *x = *y = 0;
for (; f; f = FRAME_PARENT_FRAME (f))
{
- *rx += f->left_pos;
- *ry += f->top_pos;
+ *x += f->left_pos;
+ *y += f->top_pos;
}
}
frame_rect_abs (struct frame *f)
{
int x, y;
- root_xy (f, 0, 0, &x, &y);
+ frame_pos_abs (f, &x, &y);
return (struct rect) { x, y, f->total_cols, f->total_lines };
}
wx += max (0, w->left_margin_cols);
- root_xy (f, wx, wy, x, y);
+ int fx, fy;
+ frame_pos_abs (f, &fx, &fy);
+ *x = fx + wx;
+ *y = fy + wy;
return true;
}
struct frame *sf = SELECTED_FRAME ();
if (f == sf || is_frame_ancestor (sf, f))
{
- int mx = XFIXNUM (XCAR (XCDR (mouse)));
- int my = XFIXNUM (XCDR (XCDR (mouse)));
- root_xy (f, mx, my, x, y);
+ int fx, fy;
+ frame_pos_abs (f, &fx, &fy);
+ *x = fx + XFIXNUM (XCAR (XCDR (mouse)));
+ *y = fy + XFIXNUM (XCDR (XCDR (mouse)));
}
}