changeset 47742:8d54d470f30d

* xterm.c (XTread_socket): For ConfigureNotify, with x and y == 0, and USE_MOTIF, call XTranslateCoordinates to get the real x and y. This is to also handle x/y changes that occur because of a resize.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 03 Oct 2002 17:51:49 +0000
parents be7a44c8fe9c
children 2626f97f0c1c
files src/xterm.c
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Thu Oct 03 13:46:25 2002 +0000
+++ b/src/xterm.c	Thu Oct 03 17:51:49 2002 +0000
@@ -11179,8 +11179,24 @@
 		     in the emacs widget, which messes up Motif menus.  */
 		  if (event.xconfigure.x == 0 && event.xconfigure.y == 0)
 		    {
-		      event.xconfigure.x = f->output_data.x->widget->core.x;
-		      event.xconfigure.y = f->output_data.x->widget->core.y;
+                      Window child;
+		      int count;
+
+		      /* We can get a ConfigureNotify because of a resize,
+			 so we can't just take x and y from the widget.
+			 Since this event may come on something else than
+			 the top level window,  we can't use x_real_position
+			 either.  So we get the root window x/y for 0/0 in
+			 the window in the event. */
+		      count = x_catch_errors (FRAME_X_DISPLAY (f));
+                      XTranslateCoordinates (FRAME_X_DISPLAY (f),
+                                             event.xconfigure.window,
+                                             FRAME_X_DISPLAY_INFO (f)->root_window,
+                                             0, 0,
+                                             &event.xconfigure.x,
+                                             &event.xconfigure.y,
+                                             &child);
+		      x_uncatch_errors (FRAME_X_DISPLAY (f), count);
 		    }
 #endif /* USE_MOTIF */
 		}