changeset 3283:e2a40a3baa4b

(Ficonify_frame, Fmake_frame_invisible): Select some other frame. Move minibuffer off this frame. (Fhandle_switch_frame): Don't call Ffocus_frame. (Fredirect_frame_focus): Call Ffocus_frame here.
author Richard M. Stallman <rms@gnu.org>
date Sun, 30 May 1993 02:44:11 +0000
parents a3c8d3866d01
children a47979ffad1e
files src/frame.c
diffstat 1 files changed, 31 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.c	Sun May 30 00:55:42 1993 +0000
+++ b/src/frame.c	Sun May 30 02:44:11 1993 +0000
@@ -391,15 +391,6 @@
     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
@@ -832,6 +823,18 @@
 
   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)))
@@ -853,6 +856,18 @@
   
   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)))
@@ -971,6 +986,13 @@
 
   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) ();