comparison src/xterm.c @ 3045:0267fb20b0df

(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.
author Richard M. Stallman <rms@gnu.org>
date Tue, 25 May 1993 01:00:21 +0000
parents 2c5ea1c98256
children 039cbddadc51
comparison
equal deleted inserted replaced
3044:81c1ecaafd88 3045:0267fb20b0df
2695 x_send_incremental (event); 2695 x_send_incremental (event);
2696 } 2696 }
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)
2703 { 2709 {
2704 if (f->async_visible == 0) 2710 if (f->async_visible == 0)
3088 { 3094 {
3089 change_frame_size (f, rows, columns, 0, 1); 3095 change_frame_size (f, rows, columns, 0, 1);
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,
3111 event.xconfigure.y, 3114 event.xconfigure.y,
3112 &win_x, &win_y, 3115 &win_x, &win_y,