diff options
| author | Jan Djärv | 2004-02-28 16:22:06 +0000 |
|---|---|---|
| committer | Jan Djärv | 2004-02-28 16:22:06 +0000 |
| commit | b59dd9c82369741f3b399af88fac9fe54412589a (patch) | |
| tree | 2c571f2a55e26f33a7278e445a25036f9f283bad /src | |
| parent | c0bf9913f8aa356b6287401f7b99d06f5667ec42 (diff) | |
| download | emacs-b59dd9c82369741f3b399af88fac9fe54412589a.tar.gz emacs-b59dd9c82369741f3b399af88fac9fe54412589a.zip | |
xfns.c (x_window): Fixed indentation
* xterm.c (x_calc_absolute_position): Call x_real_positions
to get WM window sizes and use those to calculate position.
(x_set_offset): Removed code commented out.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/xfns.c | 2 | ||||
| -rw-r--r-- | src/xterm.c | 68 |
3 files changed, 19 insertions, 59 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8b5944a1866..946c92fecd5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2004-02-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xfns.c (x_window): Fixed indentation. | ||
| 4 | |||
| 5 | * xterm.c (x_calc_absolute_position): Call x_real_positions | ||
| 6 | to get WM window sizes and use those to calculate position. | ||
| 7 | (x_set_offset): Removed code commented out. | ||
| 8 | |||
| 1 | 2004-02-28 Miles Bader <miles@gnu.org> | 9 | 2004-02-28 Miles Bader <miles@gnu.org> |
| 2 | 10 | ||
| 3 | * keyboard.c (adjust_point_for_property): #ifdef-out dodgy xassert. | 11 | * keyboard.c (adjust_point_for_property): #ifdef-out dodgy xassert. |
diff --git a/src/xfns.c b/src/xfns.c index f5e3c0c62e5..a3e885bac74 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2837,7 +2837,7 @@ x_window (f) | |||
| 2837 | 2837 | ||
| 2838 | #ifdef HAVE_X_I18N | 2838 | #ifdef HAVE_X_I18N |
| 2839 | FRAME_XIC (f) = NULL; | 2839 | FRAME_XIC (f) = NULL; |
| 2840 | if (use_xim) | 2840 | if (use_xim) |
| 2841 | { | 2841 | { |
| 2842 | BLOCK_INPUT; | 2842 | BLOCK_INPUT; |
| 2843 | create_frame_xic (f); | 2843 | create_frame_xic (f); |
diff --git a/src/xterm.c b/src/xterm.c index 0f1faeafbbd..9e34d988b91 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -8137,65 +8137,24 @@ x_calc_absolute_position (f) | |||
| 8137 | Window child; | 8137 | Window child; |
| 8138 | int win_x = 0, win_y = 0; | 8138 | int win_x = 0, win_y = 0; |
| 8139 | int flags = f->size_hint_flags; | 8139 | int flags = f->size_hint_flags; |
| 8140 | int this_window; | ||
| 8141 | 8140 | ||
| 8142 | /* We have nothing to do if the current position | 8141 | /* We have nothing to do if the current position |
| 8143 | is already for the top-left corner. */ | 8142 | is already for the top-left corner. */ |
| 8144 | if (! ((flags & XNegative) || (flags & YNegative))) | 8143 | if (! ((flags & XNegative) || (flags & YNegative))) |
| 8145 | return; | 8144 | return; |
| 8146 | 8145 | ||
| 8147 | this_window = FRAME_OUTER_WINDOW (f); | 8146 | /* Find the offsets of the outside upper-left corner of |
| 8148 | |||
| 8149 | /* Find the position of the outside upper-left corner of | ||
| 8150 | the inner window, with respect to the outer window. | 8147 | the inner window, with respect to the outer window. |
| 8151 | But do this only if we will need the results. */ | 8148 | But do this only if we will need the results. */ |
| 8152 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) | 8149 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
| 8153 | { | 8150 | /* This is to get *_pixels_outer_diff. */ |
| 8154 | int count; | 8151 | x_real_positions (f, &win_x, &win_y); |
| 8155 | |||
| 8156 | BLOCK_INPUT; | ||
| 8157 | count = x_catch_errors (FRAME_X_DISPLAY (f)); | ||
| 8158 | while (1) | ||
| 8159 | { | ||
| 8160 | x_clear_errors (FRAME_X_DISPLAY (f)); | ||
| 8161 | XTranslateCoordinates (FRAME_X_DISPLAY (f), | ||
| 8162 | |||
| 8163 | /* From-window, to-window. */ | ||
| 8164 | this_window, | ||
| 8165 | f->output_data.x->parent_desc, | ||
| 8166 | |||
| 8167 | /* From-position, to-position. */ | ||
| 8168 | 0, 0, &win_x, &win_y, | ||
| 8169 | |||
| 8170 | /* Child of win. */ | ||
| 8171 | &child); | ||
| 8172 | if (x_had_errors_p (FRAME_X_DISPLAY (f))) | ||
| 8173 | { | ||
| 8174 | Window newroot, newparent = 0xdeadbeef; | ||
| 8175 | Window *newchildren; | ||
| 8176 | unsigned int nchildren; | ||
| 8177 | |||
| 8178 | if (! XQueryTree (FRAME_X_DISPLAY (f), this_window, &newroot, | ||
| 8179 | &newparent, &newchildren, &nchildren)) | ||
| 8180 | break; | ||
| 8181 | |||
| 8182 | XFree ((char *) newchildren); | ||
| 8183 | |||
| 8184 | f->output_data.x->parent_desc = newparent; | ||
| 8185 | } | ||
| 8186 | else | ||
| 8187 | break; | ||
| 8188 | } | ||
| 8189 | |||
| 8190 | x_uncatch_errors (FRAME_X_DISPLAY (f), count); | ||
| 8191 | UNBLOCK_INPUT; | ||
| 8192 | } | ||
| 8193 | 8152 | ||
| 8194 | /* Treat negative positions as relative to the leftmost bottommost | 8153 | /* Treat negative positions as relative to the leftmost bottommost |
| 8195 | position that fits on the screen. */ | 8154 | position that fits on the screen. */ |
| 8196 | if (flags & XNegative) | 8155 | if (flags & XNegative) |
| 8197 | f->left_pos = (FRAME_X_DISPLAY_INFO (f)->width | 8156 | f->left_pos = (FRAME_X_DISPLAY_INFO (f)->width |
| 8198 | - 2 * f->border_width - win_x | 8157 | - 2 * FRAME_X_OUTPUT (f)->x_pixels_outer_diff |
| 8199 | - FRAME_PIXEL_WIDTH (f) | 8158 | - FRAME_PIXEL_WIDTH (f) |
| 8200 | + f->left_pos); | 8159 | + f->left_pos); |
| 8201 | 8160 | ||
| @@ -8220,8 +8179,12 @@ x_calc_absolute_position (f) | |||
| 8220 | 8179 | ||
| 8221 | if (flags & YNegative) | 8180 | if (flags & YNegative) |
| 8222 | f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height | 8181 | f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height |
| 8223 | - 2 * f->border_width | 8182 | - FRAME_X_OUTPUT (f)->y_pixels_outer_diff |
| 8224 | - win_y | 8183 | |
| 8184 | /* Assume the window manager decorations are the same size on | ||
| 8185 | three sides, i.e. left, right and bottom. This is to | ||
| 8186 | compensate for the bottom part. */ | ||
| 8187 | - FRAME_X_OUTPUT (f)->x_pixels_outer_diff | ||
| 8225 | - height | 8188 | - height |
| 8226 | + f->top_pos); | 8189 | + f->top_pos); |
| 8227 | } | 8190 | } |
| @@ -8265,17 +8228,6 @@ x_set_offset (f, xoff, yoff, change_gravity) | |||
| 8265 | modified_left = f->left_pos; | 8228 | modified_left = f->left_pos; |
| 8266 | modified_top = f->top_pos; | 8229 | modified_top = f->top_pos; |
| 8267 | 8230 | ||
| 8268 | #if 0 /* Running on psilocin (Debian), and displaying on the NCD X-terminal, | ||
| 8269 | this seems to be unnecessary and incorrect. rms, 4/17/97. */ | ||
| 8270 | /* It is a mystery why we need to add the border_width here | ||
| 8271 | when the frame is already visible, but experiment says we do. */ | ||
| 8272 | if (change_gravity != 0) | ||
| 8273 | { | ||
| 8274 | modified_left += f->border_width; | ||
| 8275 | modified_top += f->border_width; | ||
| 8276 | } | ||
| 8277 | #endif | ||
| 8278 | |||
| 8279 | if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A) | 8231 | if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A) |
| 8280 | { | 8232 | { |
| 8281 | /* Some WMs (twm, wmaker at least) has an offset that is smaller | 8233 | /* Some WMs (twm, wmaker at least) has an offset that is smaller |