diff options
| author | Richard M. Stallman | 1997-05-26 07:53:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-26 07:53:35 +0000 |
| commit | 8a07bba056ee23c4294d490115549a90671bff17 (patch) | |
| tree | 164fe790e826320c1bf5459ee074eb2e9ffa19a0 /src | |
| parent | 9829ddba7bb78968059a4de4cf956ab5f12a6a2d (diff) | |
| download | emacs-8a07bba056ee23c4294d490115549a90671bff17.tar.gz emacs-8a07bba056ee23c4294d490115549a90671bff17.zip | |
(x_real_positions): Directly compare the frame's window
or parent with the root window.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/xfns.c b/src/xfns.c index ed7f726889c..7a31b26ec5e 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -969,6 +969,7 @@ x_real_positions (f, xptr, yptr) | |||
| 969 | while (1) | 969 | while (1) |
| 970 | { | 970 | { |
| 971 | int count = x_catch_errors (FRAME_X_DISPLAY (f)); | 971 | int count = x_catch_errors (FRAME_X_DISPLAY (f)); |
| 972 | Window outer_window; | ||
| 972 | 973 | ||
| 973 | XQueryTree (FRAME_X_DISPLAY (f), outer, &tmp_root_window, | 974 | XQueryTree (FRAME_X_DISPLAY (f), outer, &tmp_root_window, |
| 974 | &f->output_data.x->parent_desc, | 975 | &f->output_data.x->parent_desc, |
| @@ -980,28 +981,21 @@ x_real_positions (f, xptr, yptr) | |||
| 980 | /* Find the position of the outside upper-left corner of | 981 | /* Find the position of the outside upper-left corner of |
| 981 | the inner window, with respect to the outer window. */ | 982 | the inner window, with respect to the outer window. */ |
| 982 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) | 983 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
| 983 | { | 984 | outer_window = f->output_data.x->parent_desc; |
| 984 | XTranslateCoordinates (FRAME_X_DISPLAY (f), | 985 | else |
| 986 | outer_window = outer; | ||
| 985 | 987 | ||
| 986 | /* From-window, to-window. */ | 988 | XTranslateCoordinates (FRAME_X_DISPLAY (f), |
| 987 | #ifdef USE_X_TOOLKIT | ||
| 988 | XtWindow (f->output_data.x->widget), | ||
| 989 | #else | ||
| 990 | f->output_data.x->window_desc, | ||
| 991 | #endif | ||
| 992 | f->output_data.x->parent_desc, | ||
| 993 | 989 | ||
| 994 | /* From-position, to-position. */ | 990 | /* From-window, to-window. */ |
| 995 | 0, 0, &win_x, &win_y, | 991 | outer_window, |
| 992 | FRAME_X_DISPLAY_INFO (f)->root_window, | ||
| 996 | 993 | ||
| 997 | /* Child of win. */ | 994 | /* From-position, to-position. */ |
| 998 | &child); | 995 | 0, 0, &win_x, &win_y, |
| 999 | 996 | ||
| 1000 | #if 0 /* The values seem to be right without this and wrong with. */ | 997 | /* Child of win. */ |
| 1001 | win_x += f->output_data.x->border_width; | 998 | &child); |
| 1002 | win_y += f->output_data.x->border_width; | ||
| 1003 | #endif | ||
| 1004 | } | ||
| 1005 | 999 | ||
| 1006 | /* It is possible for the window returned by the XQueryNotify | 1000 | /* It is possible for the window returned by the XQueryNotify |
| 1007 | to become invalid by the time we call XTranslateCoordinates. | 1001 | to become invalid by the time we call XTranslateCoordinates. |
| @@ -1017,8 +1011,8 @@ x_real_positions (f, xptr, yptr) | |||
| 1017 | x_uncatch_errors (FRAME_X_DISPLAY (f), count); | 1011 | x_uncatch_errors (FRAME_X_DISPLAY (f), count); |
| 1018 | } | 1012 | } |
| 1019 | 1013 | ||
| 1020 | *xptr = f->output_data.x->left_pos - win_x; | 1014 | *xptr = win_x; |
| 1021 | *yptr = f->output_data.x->top_pos - win_y; | 1015 | *yptr = win_y; |
| 1022 | } | 1016 | } |
| 1023 | 1017 | ||
| 1024 | /* Insert a description of internally-recorded parameters of frame X | 1018 | /* Insert a description of internally-recorded parameters of frame X |