]> code.delx.au - gnu-emacs/commitdiff
(wm_delete_window): Check all the shell's children,
authorRichard M. Stallman <rms@gnu.org>
Sat, 18 Sep 1999 03:02:03 +0000 (03:02 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 18 Sep 1999 03:02:03 +0000 (03:02 +0000)
not just the first, to find the dialog box.

lwlib/lwlib-Xaw.c

index 21685659ae565accfc538bc1582de9d8a776d216..e56a11c265afabda30958e0b026cd51f32df1ca8 100644 (file)
@@ -501,16 +501,22 @@ wm_delete_window (shell, closure, call_data)
      XtPointer call_data;
 {
   LWLIB_ID id;
+  Cardinal nkids;
+  int i;
   Widget *kids = 0;
   Widget widget;
   if (! XtIsSubclass (shell, shellWidgetClass))
     abort ();
+  XtVaGetValues (shell, XtNnumChildren, &nkids, 0);
   XtVaGetValues (shell, XtNchildren, &kids, 0);
   if (!kids || !*kids)
     abort ();
-  widget = kids [0];
-  if (! XtIsSubclass (widget, dialogWidgetClass))
-    abort ();
+  for (i = 0; i < nkids; i++)
+    {
+      widget = kids[i];
+      if (XtIsSubclass (widget, dialogWidgetClass))
+       break;
+    }
   id = lw_get_widget_id (widget);
   if (! id) abort ();