[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/frame.el,v
From: |
Martin Rudalics |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/frame.el,v |
Date: |
Sat, 13 Sep 2008 08:28:05 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Martin Rudalics <m061211> 08/09/13 08:28:05
Index: frame.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/frame.el,v
retrieving revision 1.279
retrieving revision 1.280
diff -u -b -r1.279 -r1.280
--- frame.el 3 Sep 2008 09:16:50 -0000 1.279
+++ frame.el 13 Sep 2008 08:28:04 -0000 1.280
@@ -848,7 +848,17 @@
(when (memq (window-system frame) '(x w32 ns))
(x-focus-frame frame))
(when focus-follows-mouse
- (set-mouse-position (selected-frame) (1- (frame-width)) 0)))
+ ;; When the mouse cursor is not in FRAME's selected window move it
+ ;; there to avoid that some other window gets selected when focus
+ ;; follows mouse.
+ (condition-case nil
+ (let ((window (frame-selected-window frame))
+ (coordinates (cdr-safe (mouse-position))))
+ (unless (and (car-safe coordinates)
+ (coordinates-in-window-p coordinates window))
+ (let ((edges (window-inside-edges (frame-selected-window frame))))
+ (set-mouse-position frame (nth 2 edges) (nth 1 edges)))))
+ (error nil))))
(defun other-frame (arg)
"Select the ARGth different visible frame on current display, and raise it.