Malcolm Purvis writes:
Hey, thanks for poking at it! I would have just ignored this due to
the age of "Rational FORTRAN". :-(
Unfortunately this particular bug is still around and I can reproduce
is
with 21.4.20 and 21.5 HEAD on a Gentoo Linux box.
Oh, I see it now. I don't use dialogs, normally, and when I do, I
don't talk to the window manager, I talk to XEmacs. Reproduced on Mac
in the Aqua WM (which doesn't have a visible X button in the wm
decorations, until you actually click it :-P ).
What's happening, it appears, is that some WMs use a vendor extension
record in their shell widget. In editres(1X) it appears as a widget,
I dunno, maybe it is a widget. Whatever, it's sitting in kids[0], and
it's not what we expect to be there. Tsk, tsk, window manager
programming skills are going downhill rapidly, I guess. ;-) I think
what needs to be done is to iterate over the Widget kids[] array until
we find a dialogWidgetClass widget with an lwlib id. If not found,
*then* we can abort. ;-)
This patch works for me in light testing.
I abort immediately if the first dialogWidgetClass widget has no lwlib
id, because as I understand the theory of shell widgets, the shell
should only ever have one "real" child widget. (Really, those should
be asserts; anybody know why they're not?)
The !*kids in the sanity check after XGetValues is redundant (it will
get caught by the !widget check), but I think a shell that reports it
has no kids is almost certainly serious Xt or wm breakage, while a
non-dialog shell might theoretically be our mistake somehow. Since we
need a check for !kids, may as well check for !*kids at the same time.
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index b497019..27dbba2 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -599,11 +599,14 @@ wm_delete_window (Widget shell, XtPointer UNUSED (closure),
abort ();
XtSetArg (al [0], XtNchildren, &kids);
XtGetValues (shell, al, 1);
- if (!kids || !*kids)
- abort ();
- widget = kids [0];
- if (! XtIsSubclass (widget, dialogWidgetClass))
- abort ();
+ if (!kids || !*kids) abort ();
+
+ for (widget = *kids;
+ widget && ! XtIsSubclass (widget, dialogWidgetClass);
+ widget = *++kids)
+ ;
+ if (!widget) abort ();
+
id = lw_get_widget_id (widget);
if (! id) abort ();
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta