From 0331883833db885c1de2708379bb7b351d213680 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 3 Oct 2002 17:53:23 +0000 Subject: [PATCH] * 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. --- src/ChangeLog | 6 ++++++ src/xterm.c | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e7055f1af2a..4608db9e3b6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2002-10-03 Jan D. + + * 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. + 2002-10-02 John Paul Wallington * frame.c (Vdelete_frame_functions): New variable. diff --git a/src/xterm.c b/src/xterm.c index 731f94e7e44..e457d6e4519 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11179,8 +11179,24 @@ XTread_socket (sd, bufp, numchars, expected) 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 */ } -- 2.39.2