diff options
| author | Richard M. Stallman | 1994-05-08 21:03:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-05-08 21:03:21 +0000 |
| commit | e9445337f786880b2f4ccbbdd85b3606be03f238 (patch) | |
| tree | 83bd1fa05c02e9b399d910d59d6afc6e4ca8a505 /src | |
| parent | fa974a004ae8d3cc53dd4240e919898222ebbe54 (diff) | |
| download | emacs-e9445337f786880b2f4ccbbdd85b3606be03f238.tar.gz emacs-e9445337f786880b2f4ccbbdd85b3606be03f238.zip | |
(x_real_positions): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c index 79a2b2b347d..c0313b20b01 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -547,6 +547,47 @@ x_set_frame_parameters (f, alist) | |||
| 547 | } | 547 | } |
| 548 | } | 548 | } |
| 549 | 549 | ||
| 550 | /* Store the positions of frame F into XPTR and YPTR. | ||
| 551 | These are the positions of the containing window manager window, | ||
| 552 | not Emacs's own window. */ | ||
| 553 | |||
| 554 | void | ||
| 555 | x_real_positions (f, xptr, yptr) | ||
| 556 | FRAME_PTR f; | ||
| 557 | int *xptr, *yptr; | ||
| 558 | { | ||
| 559 | int win_x = 0, win_y = 0; | ||
| 560 | Window child; | ||
| 561 | |||
| 562 | /* Find the position of the outside upper-left corner of | ||
| 563 | the inner window, with respect to the outer window. */ | ||
| 564 | if (f->display.x->parent_desc != ROOT_WINDOW) | ||
| 565 | { | ||
| 566 | BLOCK_INPUT; | ||
| 567 | XTranslateCoordinates (x_current_display, | ||
| 568 | |||
| 569 | /* From-window, to-window. */ | ||
| 570 | #ifdef USE_X_TOOLKIT | ||
| 571 | XtWindow (f->display.x->widget), | ||
| 572 | #else | ||
| 573 | f->display.x->window_desc, | ||
| 574 | #endif | ||
| 575 | f->display.x->parent_desc, | ||
| 576 | |||
| 577 | /* From-position, to-position. */ | ||
| 578 | 0, 0, &win_x, &win_y, | ||
| 579 | |||
| 580 | /* Child of win. */ | ||
| 581 | &child); | ||
| 582 | UNBLOCK_INPUT; | ||
| 583 | |||
| 584 | win_x += f->display.x->border_width; | ||
| 585 | win_y += f->display.x->border_width; | ||
| 586 | } | ||
| 587 | *xptr = f->display.x->left_pos - win_x; | ||
| 588 | *yptr = f->display.x->top_pos - win_y; | ||
| 589 | } | ||
| 590 | |||
| 550 | /* Insert a description of internally-recorded parameters of frame X | 591 | /* Insert a description of internally-recorded parameters of frame X |
| 551 | into the parameter alist *ALISTPTR that is to be given to the user. | 592 | into the parameter alist *ALISTPTR that is to be given to the user. |
| 552 | Only parameters that are specific to the X window system | 593 | Only parameters that are specific to the X window system |