diff options
| author | Richard M. Stallman | 1994-05-08 21:06:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-05-08 21:06:13 +0000 |
| commit | 3a35ab44bdfcf92b6c1bf9507e2fee5646f95b7d (patch) | |
| tree | 69240f7ac312c4022262cb55958db6b549a07fb7 | |
| parent | e9445337f786880b2f4ccbbdd85b3606be03f238 (diff) | |
| download | emacs-3a35ab44bdfcf92b6c1bf9507e2fee5646f95b7d.tar.gz emacs-3a35ab44bdfcf92b6c1bf9507e2fee5646f95b7d.zip | |
(x_set_offset): Set gravity and size hint
before moving the window.
(XTread_socket): For ReparentNotify, use x_top_window_to_frame.
Also recompute frame position using x_real_positions.
For ConfigureNotify, don't ignore send_events.
Also recompute frame position using x_real_positions.
| -rw-r--r-- | src/xterm.c | 65 |
1 files changed, 50 insertions, 15 deletions
diff --git a/src/xterm.c b/src/xterm.c index 1ea7c4d0e7d..bc6b614f4dc 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -3530,9 +3530,15 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3530 | break; | 3530 | break; |
| 3531 | 3531 | ||
| 3532 | case ReparentNotify: | 3532 | case ReparentNotify: |
| 3533 | f = x_window_to_frame (event.xreparent.window); | 3533 | f = x_top_window_to_frame (event.xreparent.window); |
| 3534 | if (f) | 3534 | if (f) |
| 3535 | f->display.x->parent_desc = event.xreparent.parent; | 3535 | { |
| 3536 | int x, y; | ||
| 3537 | f->display.x->parent_desc = event.xreparent.parent; | ||
| 3538 | x_real_positions (f, &x, &y); | ||
| 3539 | f->display.x->left_pos = x; | ||
| 3540 | f->display.x->top_pos = y; | ||
| 3541 | } | ||
| 3536 | break; | 3542 | break; |
| 3537 | 3543 | ||
| 3538 | case Expose: | 3544 | case Expose: |
| @@ -4027,7 +4033,9 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 4027 | f = x_any_window_to_frame (event.xconfigure.window); | 4033 | f = x_any_window_to_frame (event.xconfigure.window); |
| 4028 | #ifdef USE_X_TOOLKIT | 4034 | #ifdef USE_X_TOOLKIT |
| 4029 | if (f | 4035 | if (f |
| 4036 | #if 0 | ||
| 4030 | && ! event.xconfigure.send_event | 4037 | && ! event.xconfigure.send_event |
| 4038 | #endif | ||
| 4031 | && (event.xconfigure.window == XtWindow (f->display.x->widget))) | 4039 | && (event.xconfigure.window == XtWindow (f->display.x->widget))) |
| 4032 | { | 4040 | { |
| 4033 | Window win, child; | 4041 | Window win, child; |
| @@ -4058,6 +4066,15 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 4058 | f->display.x->pixel_height = event.xconfigure.height; | 4066 | f->display.x->pixel_height = event.xconfigure.height; |
| 4059 | f->display.x->left_pos = event.xconfigure.x; | 4067 | f->display.x->left_pos = event.xconfigure.x; |
| 4060 | f->display.x->top_pos = event.xconfigure.y; | 4068 | f->display.x->top_pos = event.xconfigure.y; |
| 4069 | |||
| 4070 | /* What we have now is the position of Emacs's own window. | ||
| 4071 | Convert that to the position of the window manager window. */ | ||
| 4072 | { | ||
| 4073 | int x, y; | ||
| 4074 | x_real_positions (f, &x, &y); | ||
| 4075 | f->display.x->left_pos = x; | ||
| 4076 | f->display.x->top_pos = y; | ||
| 4077 | } | ||
| 4061 | } | 4078 | } |
| 4062 | goto OTHER; | 4079 | goto OTHER; |
| 4063 | #else /* not USE_X_TOOLKIT */ | 4080 | #else /* not USE_X_TOOLKIT */ |
| @@ -4109,6 +4126,15 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 4109 | f->display.x->pixel_height = event.xconfigure.height; | 4126 | f->display.x->pixel_height = event.xconfigure.height; |
| 4110 | f->display.x->left_pos = event.xconfigure.x; | 4127 | f->display.x->left_pos = event.xconfigure.x; |
| 4111 | f->display.x->top_pos = event.xconfigure.y; | 4128 | f->display.x->top_pos = event.xconfigure.y; |
| 4129 | |||
| 4130 | /* What we have now is the position of Emacs's own window. | ||
| 4131 | Convert that to the position of the window manager window. */ | ||
| 4132 | { | ||
| 4133 | int x, y; | ||
| 4134 | x_real_positions (f, &x, &y); | ||
| 4135 | f->display.x->left_pos = x; | ||
| 4136 | f->display.x->top_pos = y; | ||
| 4137 | } | ||
| 4112 | } | 4138 | } |
| 4113 | #endif /* not USE_X_TOOLKIT */ | 4139 | #endif /* not USE_X_TOOLKIT */ |
| 4114 | break; | 4140 | break; |
| @@ -5148,6 +5174,10 @@ x_calc_absolute_position (f) | |||
| 5148 | - 2 * f->display.x->border_width - win_y | 5174 | - 2 * f->display.x->border_width - win_y |
| 5149 | - PIXEL_HEIGHT (f) | 5175 | - PIXEL_HEIGHT (f) |
| 5150 | + f->display.x->top_pos); | 5176 | + f->display.x->top_pos); |
| 5177 | /* The left_pos and top_pos | ||
| 5178 | are now relative to the top and left screen edges, | ||
| 5179 | so the flags should correspond. */ | ||
| 5180 | f->display.x->size_hint_flags &= ~ (XNegative | YNegative); | ||
| 5151 | #else /* ! defined (HAVE_X11) */ | 5181 | #else /* ! defined (HAVE_X11) */ |
| 5152 | WINDOWINFO_TYPE parentinfo; | 5182 | WINDOWINFO_TYPE parentinfo; |
| 5153 | 5183 | ||
| @@ -5163,21 +5193,32 @@ x_calc_absolute_position (f) | |||
| 5163 | #endif /* ! defined (HAVE_X11) */ | 5193 | #endif /* ! defined (HAVE_X11) */ |
| 5164 | } | 5194 | } |
| 5165 | 5195 | ||
| 5196 | /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, | ||
| 5197 | to really change the position, and 0 when calling from | ||
| 5198 | x_make_frame_visible (in that case, XOFF and YOFF are the current | ||
| 5199 | position values). */ | ||
| 5200 | |||
| 5166 | x_set_offset (f, xoff, yoff, change_gravity) | 5201 | x_set_offset (f, xoff, yoff, change_gravity) |
| 5167 | struct frame *f; | 5202 | struct frame *f; |
| 5168 | register int xoff, yoff; | 5203 | register int xoff, yoff; |
| 5169 | int change_gravity; | 5204 | int change_gravity; |
| 5170 | { | 5205 | { |
| 5171 | f->display.x->top_pos = yoff; | 5206 | if (change_gravity) |
| 5172 | f->display.x->left_pos = xoff; | 5207 | { |
| 5173 | f->display.x->size_hint_flags &= ~ (XNegative | YNegative); | 5208 | f->display.x->top_pos = yoff; |
| 5174 | if (xoff < 0) | 5209 | f->display.x->left_pos = xoff; |
| 5175 | f->display.x->size_hint_flags |= XNegative; | 5210 | f->display.x->size_hint_flags &= ~ (XNegative | YNegative); |
| 5176 | if (yoff < 0) | 5211 | if (xoff < 0) |
| 5177 | f->display.x->size_hint_flags |= YNegative; | 5212 | f->display.x->size_hint_flags |= XNegative; |
| 5213 | if (yoff < 0) | ||
| 5214 | f->display.x->size_hint_flags |= YNegative; | ||
| 5215 | f->display.x->win_gravity = NorthWestGravity; | ||
| 5216 | } | ||
| 5178 | x_calc_absolute_position (f); | 5217 | x_calc_absolute_position (f); |
| 5179 | 5218 | ||
| 5180 | BLOCK_INPUT; | 5219 | BLOCK_INPUT; |
| 5220 | x_wm_set_size_hint (f, 0, 0); | ||
| 5221 | |||
| 5181 | #ifdef USE_X_TOOLKIT | 5222 | #ifdef USE_X_TOOLKIT |
| 5182 | XMoveWindow (XDISPLAY XtWindow (f->display.x->widget), | 5223 | XMoveWindow (XDISPLAY XtWindow (f->display.x->widget), |
| 5183 | f->display.x->left_pos, f->display.x->top_pos); | 5224 | f->display.x->left_pos, f->display.x->top_pos); |
| @@ -5185,12 +5226,6 @@ x_set_offset (f, xoff, yoff, change_gravity) | |||
| 5185 | XMoveWindow (XDISPLAY FRAME_X_WINDOW (f), | 5226 | XMoveWindow (XDISPLAY FRAME_X_WINDOW (f), |
| 5186 | f->display.x->left_pos, f->display.x->top_pos); | 5227 | f->display.x->left_pos, f->display.x->top_pos); |
| 5187 | #endif /* not USE_X_TOOLKIT */ | 5228 | #endif /* not USE_X_TOOLKIT */ |
| 5188 | #ifdef HAVE_X11 | ||
| 5189 | if (change_gravity) | ||
| 5190 | f->display.x->win_gravity = NorthWestGravity; | ||
| 5191 | |||
| 5192 | x_wm_set_size_hint (f, 0, 0); | ||
| 5193 | #endif /* ! defined (HAVE_X11) */ | ||
| 5194 | UNBLOCK_INPUT; | 5229 | UNBLOCK_INPUT; |
| 5195 | } | 5230 | } |
| 5196 | 5231 | ||