diff options
| author | Richard M. Stallman | 1993-05-25 01:00:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-25 01:00:21 +0000 |
| commit | 3bd330d47a1f0c6d008e2d5ffe8612d1e9bce28c (patch) | |
| tree | 06cf1c48204817d6074192aa46654cee8bb2409b | |
| parent | 5b3bb7c63d5cda497d05c86a2f9216e864a3713d (diff) | |
| download | emacs-3bd330d47a1f0c6d008e2d5ffe8612d1e9bce28c.tar.gz emacs-3bd330d47a1f0c6d008e2d5ffe8612d1e9bce28c.zip | |
(XTread_socket, ConfigureNotify case):
Convert from parent window, not Emacs window.
(XTread_socket): Handle ReparentNotify events.
(XTread_socket): For ConfigureNotify event,
translate coordinates if send_event field is false
provided the x-coord value is not large.
| -rw-r--r-- | src/xterm.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index 8970185967c..046cf5100a6 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2697,6 +2697,12 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 2697 | #endif | 2697 | #endif |
| 2698 | break; | 2698 | break; |
| 2699 | 2699 | ||
| 2700 | case ReparentNotify: | ||
| 2701 | f = x_window_to_frame (event.xreparent.window); | ||
| 2702 | if (f) | ||
| 2703 | f->display.x->parent_desc = event.xreparent.parent; | ||
| 2704 | break; | ||
| 2705 | |||
| 2700 | case Expose: | 2706 | case Expose: |
| 2701 | f = x_window_to_frame (event.xexpose.window); | 2707 | f = x_window_to_frame (event.xexpose.window); |
| 2702 | if (f) | 2708 | if (f) |
| @@ -3090,21 +3096,18 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3090 | SET_FRAME_GARBAGED (f); | 3096 | SET_FRAME_GARBAGED (f); |
| 3091 | } | 3097 | } |
| 3092 | 3098 | ||
| 3093 | if (! event.xconfigure.send_event | 3099 | if (! event.xconfigure.send_event) |
| 3094 | /* Sometimes we get root-relative coordinates | ||
| 3095 | even tho send_event is 0. | ||
| 3096 | This is not a perfectly reliable way of distinguishing, | ||
| 3097 | but it does the right thing except in a case | ||
| 3098 | where it doesn't hurt much to be wrong. */ | ||
| 3099 | && event.xconfigure.x < 20) | ||
| 3100 | { | 3100 | { |
| 3101 | Window win, child; | 3101 | Window win, child; |
| 3102 | int win_x, win_y; | 3102 | int win_x, win_y; |
| 3103 | 3103 | ||
| 3104 | /* Coords are relative to the parent. | ||
| 3105 | Convert them to root-relative. */ | ||
| 3104 | XTranslateCoordinates (x_current_display, | 3106 | XTranslateCoordinates (x_current_display, |
| 3105 | 3107 | ||
| 3106 | /* From-window, to-window. */ | 3108 | /* From-window, to-window. */ |
| 3107 | event.xconfigure.window, ROOT_WINDOW, | 3109 | f->display.x->parent_desc, |
| 3110 | ROOT_WINDOW, | ||
| 3108 | 3111 | ||
| 3109 | /* From-position, to-position. */ | 3112 | /* From-position, to-position. */ |
| 3110 | event.xconfigure.x, | 3113 | event.xconfigure.x, |