Stef Epardaud <stef(a)lunatech.com> writes:
yes i'm begging you, otherwise tell me to fuck off and i'll
revert to an
other version of xemacs. hard to work like that :(
There is a work around in
http://www.xemacs.org/list-archives/xemacs-beta/9908/msg00516.html
However this (untested) patch should be (close) the real fix
Index: frame-x.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/frame-x.c,v
retrieving revision 1.43
diff -u -u -r1.43 frame-x.c
--- frame-x.c 1998/10/09 20:59:00 1.43
+++ frame-x.c 1999/09/23 16:56:16
@@ -103,11 +103,23 @@
struct frame *
x_any_window_to_frame (struct device *d, Window wdesc)
{
- Lisp_Object tail, frame;
- struct frame *f;
-
assert (DEVICE_X_P (d));
+ /* We used to map over al frames here and then map over all widgets
+ belonging to that frame. However it turns out that this was very fragile
+ as it requires our display stuctures to be in sync _and_ that the
+ loop is told about every new widget somebody adds. Therefore we
+ now let Xt find it for us (which does a bottom-up search which
+ could even be faster) */
+
+ return x_any_widget_or_parent_to_frame (d, XtWindowToWidget (wdesc));
+}
+
+static frame *
+x_find_frame_for_window (struct device *d, Window wdesc)
+{
+ Lisp_Object tail, frame;
+ struct frame *f;
/* This function was previously written to accept only a window argument
(and to loop over all devices looking for a matching window), but
that is incorrect because window ID's are not unique across displays. */
@@ -138,6 +150,9 @@
would incorrectly get sucked away by Emacs if this function matched
on psheet widgets. */
+ /* Note: #### Now that this called only from
+ x_any_widget_or_parent_to_frame is it still necessary to do this? */
+
for (i = 0; i < FRAME_X_NUM_TOP_WIDGETS (f); i++)
{
Widget wid = FRAME_X_TOP_WIDGETS (f)[i];
@@ -145,7 +160,14 @@
return f;
}
-#ifdef HAVE_SCROLLBARS
+#if 0
+ /* was ifdef HAVE_SCROLLBARS, but this turns out to be a bad idea
+ because
+ 1. We sometimes get events for _unmapped_ scrollbars and our
+ callers don't want us to fail.
+ 2. Starting with the 21.2 widget stuff there are now loads of
+ widgets to check and it is easy to forget adding them in a loop here.
+ See x_any_window_to_frame
/* Match if the window is one of this frame's scrollbars. */
if (x_window_is_scrollbar (f, wdesc))
return f;
@@ -160,7 +182,7 @@
{
while (widget)
{
- struct frame *f = x_any_window_to_frame (d, XtWindow (widget));
+ struct frame *f = x_find_frame_for_window (d, XtWindow (widget));
if (f)
return f;
widget = XtParent (widget);