/* Generic frame functions.
- Copyright (C) 1989, 1992, 1993 Free Software Foundation.
+ Copyright (C) 1993 Free Software Foundation.
This file is part of GNU Emacs.
f->param_alist = Qnil;
f->scroll_bars = Qnil;
f->condemned_scroll_bars = Qnil;
+ f->face_alist = Qnil;
root_window = make_window ();
if (mini_p)
last_nonminibuf_frame = selected_frame;
Fselect_window (XFRAME (frame)->selected_window);
-
- /* I think this should be done with a hook. */
-#ifdef HAVE_X_WINDOWS
- if (FRAME_X_P (XFRAME (frame))
- && NILP (no_enter))
- {
- Ffocus_frame (frame);
- }
-#endif
choose_minibuf_frame ();
/* We want to make sure that the next event generates a frame-switch
CHECK_LIVE_FRAME (frame, 0);
+ /* Don't let the frame remain selected. */
+ if (XFRAME (frame) == selected_frame)
+ Fhandle_switch_frame (next_frame (frame, Qt), Qnil);
+
+ /* Don't allow minibuf_window to remain on a deleted frame. */
+ if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
+ {
+ Fset_window_buffer (selected_frame->minibuffer_window,
+ XWINDOW (minibuf_window)->buffer);
+ minibuf_window = selected_frame->minibuffer_window;
+ }
+
/* I think this should be done with a hook. */
#ifdef HAVE_X_WINDOWS
if (FRAME_X_P (XFRAME (frame)))
CHECK_LIVE_FRAME (frame, 0);
+ /* Don't let the frame remain selected. */
+ if (XFRAME (frame) == selected_frame)
+ Fhandle_switch_frame (next_frame (frame, Qt), Qnil);
+
+ /* Don't allow minibuf_window to remain on a deleted frame. */
+ if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
+ {
+ Fset_window_buffer (selected_frame->minibuffer_window,
+ XWINDOW (minibuf_window)->buffer);
+ minibuf_window = selected_frame->minibuffer_window;
+ }
+
/* I think this should be done with a hook. */
#ifdef HAVE_X_WINDOWS
if (FRAME_X_P (XFRAME (frame)))
XFRAME (frame)->focus_frame = focus_frame;
+ /* I think this should be done with a hook. */
+#ifdef HAVE_X_WINDOWS
+ if (!NILP (focus_frame) && ! EQ (focus_frame, frame)
+ && FRAME_X_P (XFRAME (focus_frame)))
+ Ffocus_frame (focus_frame);
+#endif
+
if (frame_rehighlight_hook)
(*frame_rehighlight_hook) ();