Contents in 1999-06-04-13 of release-21-2.
[chise/xemacs-chise.git.1] / src / frame-x.c
index 4011bdb..2aa7d59 100644 (file)
@@ -328,7 +328,7 @@ x_wm_store_class_hints (Widget shell, char *frame_name)
   XSetClassHint (dpy, XtWindow (shell), &classhint);
 }
 
-#ifndef HAVE_SESSION
+#ifndef HAVE_WMCOMMAND
 static void
 x_wm_maybe_store_wm_command (struct frame *f)
 {
@@ -379,7 +379,7 @@ x_wm_maybe_move_wm_command (struct frame *f)
 
     }
 }
-#endif /* !HAVE_SESSION */
+#endif /* !HAVE_WMCOMMAND */
 
 static int
 x_frame_iconified_p (struct frame *f)
@@ -2059,9 +2059,9 @@ x_popup_frame (struct frame *f)
        /* tell the window manager about us. */
        x_wm_store_class_hints (shell_widget, XtName (frame_widget));
 
-#ifndef HAVE_SESSION
+#ifndef HAVE_WMCOMMAND
        x_wm_maybe_store_wm_command (f);
-#endif /* HAVE_SESSION */
+#endif /* HAVE_WMCOMMAND */
 
        x_wm_hack_wm_protocols (shell_widget);
       }
@@ -2623,34 +2623,37 @@ x_focus_on_frame (struct frame *f)
 static void
 x_delete_frame (struct frame *f)
 {
-#ifndef HAVE_SESSION
+  Display *dpy;
+
+#ifndef HAVE_WMCOMMAND
   if (FRAME_X_TOP_LEVEL_FRAME_P (f))
     x_wm_maybe_move_wm_command (f);
-#endif /* HAVE_SESSION */
+#endif /* HAVE_WMCOMMAND */
 
 #ifdef HAVE_CDE
   DtDndDropUnregister (FRAME_X_TEXT_WIDGET (f));
 #endif /* HAVE_CDE */
 
-  assert (FRAME_X_SHELL_WIDGET (f));
-  if (FRAME_X_SHELL_WIDGET (f))
-    {
-      Display *dpy = XtDisplay (FRAME_X_SHELL_WIDGET (f));
-      expect_x_error (dpy);
-      /* for obscure reasons having (I think) to do with the internal
-        window-to-widget hierarchy maintained by Xt, we have to call
-        XtUnrealizeWidget() here.  Xt can really suck. */
-      if (f->being_deleted)
-       XtUnrealizeWidget (FRAME_X_SHELL_WIDGET (f));
-      XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
-      x_error_occurred_p (dpy);
-
-      /* make sure the windows are really gone! */
-      /* ### Is this REALLY necessary? */
-      XFlush (dpy);
-
-      FRAME_X_SHELL_WIDGET (f) = 0;
-    }
+  assert (FRAME_X_SHELL_WIDGET (f) != 0);
+  dpy = XtDisplay (FRAME_X_SHELL_WIDGET (f));
+
+#ifdef EXTERNAL_WIDGET
+  expect_x_error (XtDisplay (FRAME_X_SHELL_WIDGET (f)));
+  /* for obscure reasons having (I think) to do with the internal
+     window-to-widget hierarchy maintained by Xt, we have to call
+     XtUnrealizeWidget() here.  Xt can really suck. */
+  if (f->being_deleted)
+    XtUnrealizeWidget (FRAME_X_SHELL_WIDGET (f));
+  XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
+  x_error_occurred_p (XtDisplay (FRAME_X_SHELL_WIDGET (f)));
+#else
+  XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
+  /* make sure the windows are really gone! */
+  /* ### Is this REALLY necessary? */
+  XFlush (dpy);
+#endif /* EXTERNAL_WIDGET */
+
+  FRAME_X_SHELL_WIDGET (f) = 0;
 
   if (FRAME_X_GEOM_FREE_ME_PLEASE (f))
     {