diff src/frame-x.c @ 375:a300bb07d72d r21-2b3

Import from CVS: tag r21-2b3
author cvs
date Mon, 13 Aug 2007 11:04:51 +0200
parents 6240c7796c7a
children 8626e4521993
line wrap: on
line diff
--- a/src/frame-x.c	Mon Aug 13 11:04:07 2007 +0200
+++ b/src/frame-x.c	Mon Aug 13 11:04:51 2007 +0200
@@ -2631,6 +2631,7 @@
 x_delete_frame (struct frame *f)
 {
   Widget w = FRAME_X_SHELL_WIDGET (f);
+  Display *dpy = XtDisplay (w);
 
 #ifndef HAVE_SESSION
   if (FRAME_X_TOP_LEVEL_FRAME_P (f))
@@ -2638,20 +2639,17 @@
 #endif /* HAVE_SESSION */
 
 #ifdef EXTERNAL_WIDGET
-  {
-    Display *dpy = XtDisplay (w);
-    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 (w);
-    XtDestroyWidget (w);
-    x_error_occurred_p (dpy);
-  }
+  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 (w);
+  XtDestroyWidget (w);
+  x_error_occurred_p (dpy);
 #else
   XtDestroyWidget (w);
-  XFlush (XtDisplay(w));   /* make sure the windows are really gone! */
+  XFlush (dpy);   /* make sure the windows are really gone! */
 #endif /* EXTERNAL_WIDGET */
 
   if (FRAME_X_GEOM_FREE_ME_PLEASE (f))