Gunnar Evermann <Gunnar.Evermann(a)nats.informatik.uni-hamburg.de> writes:
evaluating the following results in an X Error on stderr. (Linux
2.0.35, Xfree86 3.3.2, fvwm2).
(progn
(setq f (make-frame))
(delete-frame f)
(mouse-position))
xemacs: X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 40 (X_TranslateCoords)
Resource id in failed request: 0x8002cf
Serial number of failed request: 1455
Current serial number in output stream: 1455
[blahblah snipped]
--- frame-x.c.orig Sat Jun 13 06:28:48 1998
+++ frame-x.c Sat Aug 15 23:47:11 1998
@@ -2371,6 +2371,8 @@
unsigned int keys_and_buttons;
struct frame *f;
+ XSync(display, False);
+
if (XQueryPointer (display, RootWindow (display, DefaultScreen (display)),
&root_window, &child_window, &root_x, &root_y,
&win_x, &win_y, &keys_and_buttons) == False)
Ok, since Martin vetoed this patch (for good reasons) and nobody else
reacted, I need to find a different solution.
A (marginally) closer inspection reveals that XQueryPointer returns a
child_window, which produces the 'Bad Window' on the subsequent
XTranslateCoordinates call.
I guess this Window corresponds to the frame just deleted (the control
frame in ediff). Is there a way to test whether a Window will result
in a 'Bad Window'-error??
Martin suggested WINDOW_LIVE_P from window.h but unless I am mistaken
this refers to XEmacs windows and not XWindows Windows (mind the
capital W).
Any ideas? Or suggestions for a good intro book to X? Currently I only
have the man-pages :-(
Gunnar
--
Gunnar Evermann
Natural Language Systems Group, University of Hamburg
EMail: Gunnar.Evermann(a)nats.informatik.uni-hamburg.de