diff lisp/frame.el @ 280:7df0dd720c89 r21-0b38

Import from CVS: tag r21-0b38
author cvs
date Mon, 13 Aug 2007 10:32:22 +0200
parents 90d73dddcdc4
children c42ec1d1cded
line wrap: on
line diff
--- a/lisp/frame.el	Mon Aug 13 10:31:30 2007 +0200
+++ b/lisp/frame.el	Mon Aug 13 10:32:22 2007 +0200
@@ -517,9 +517,15 @@
   "Select the ARG'th different visible frame, and raise it.
 All frames are arranged in a cyclic order.
 This command selects the frame ARG steps away in that order.
-A negative ARG moves in the opposite order."
+A negative ARG moves in the opposite order.
+
+This command ignores the value of `focus-follows-mouse'."
   (interactive "p")
-  (let ((frame (selected-frame)))
+  (let ((frame (selected-frame))
+        (old-focus-follows-mouse focus-follows-mouse)
+        ;; Allow selecting another frame even when
+        ;; focus-follows-mouse is true.
+        (focus-follows-mouse nil))
     (while (> arg 0)
       (setq frame (next-frame frame 'visible-nomini))
       (setq arg (1- arg)))
@@ -528,6 +534,10 @@
       (setq arg (1+ arg)))
     (raise-frame frame)
     (select-frame frame)
+    ;; Allow the focus change to be processed while
+    ;; focus-follows-mouse is nil.
+    (and old-focus-follows-mouse
+	 (sit-for 0))
     ;this is a bad idea; you should in general never warp the
     ;pointer unless the user asks for this.  Furthermore,
     ;our version of `set-mouse-position' takes a window,