X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fframe-x.c;h=2aa7d59c28bbaa12e8ce2f4346996d911228f642;hb=f8b0dcc32dce11bef09e2fbcde040aecd1f86fd1;hp=4011bdbe1d53256fe334179b65848475a9c01304;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921;p=chise%2Fxemacs-chise.git- diff --git a/src/frame-x.c b/src/frame-x.c index 4011bdb..2aa7d59 100644 --- a/src/frame-x.c +++ b/src/frame-x.c @@ -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)) {