diff options
Diffstat (limited to 'src/dispnew.c')
| -rw-r--r-- | src/dispnew.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 724ec6ece9a..00e59c767e8 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -3313,16 +3313,18 @@ rect_intersect (struct rect *r, struct rect r1, struct rect r2) | |||
| 3313 | return true; | 3313 | return true; |
| 3314 | } | 3314 | } |
| 3315 | 3315 | ||
| 3316 | /* Return the absolute position of frame F in *X and *Y. */ | 3316 | /* Translate (X, Y) relative to frame F to absolute coordinates |
| 3317 | in (*X, *Y). */ | ||
| 3317 | 3318 | ||
| 3318 | void | 3319 | void |
| 3319 | frame_pos_abs (struct frame *f, int *x, int *y) | 3320 | root_xy (struct frame *f, int x, int y, int *rx, int *ry) |
| 3320 | { | 3321 | { |
| 3321 | *x = *y = 0; | 3322 | *rx = x; |
| 3323 | *ry = y; | ||
| 3322 | for (; f; f = FRAME_PARENT_FRAME (f)) | 3324 | for (; f; f = FRAME_PARENT_FRAME (f)) |
| 3323 | { | 3325 | { |
| 3324 | *x += f->left_pos; | 3326 | *rx += f->left_pos; |
| 3325 | *y += f->top_pos; | 3327 | *ry += f->top_pos; |
| 3326 | } | 3328 | } |
| 3327 | } | 3329 | } |
| 3328 | 3330 | ||
| @@ -3333,7 +3335,7 @@ static struct rect | |||
| 3333 | frame_rect_abs (struct frame *f) | 3335 | frame_rect_abs (struct frame *f) |
| 3334 | { | 3336 | { |
| 3335 | int x, y; | 3337 | int x, y; |
| 3336 | frame_pos_abs (f, &x, &y); | 3338 | root_xy (f, 0, 0, &x, &y); |
| 3337 | return (struct rect) { x, y, f->total_cols, f->total_lines }; | 3339 | return (struct rect) { x, y, f->total_cols, f->total_lines }; |
| 3338 | } | 3340 | } |
| 3339 | 3341 | ||
| @@ -3875,10 +3877,7 @@ abs_cursor_pos (struct frame *f, int *x, int *y) | |||
| 3875 | 3877 | ||
| 3876 | wx += max (0, w->left_margin_cols); | 3878 | wx += max (0, w->left_margin_cols); |
| 3877 | 3879 | ||
| 3878 | int fx, fy; | 3880 | root_xy (f, wx, wy, x, y); |
| 3879 | frame_pos_abs (f, &fx, &fy); | ||
| 3880 | *x = fx + wx; | ||
| 3881 | *y = fy + wy; | ||
| 3882 | return true; | 3881 | return true; |
| 3883 | } | 3882 | } |
| 3884 | 3883 | ||