From 70d5e0ce3896d12e70472a3f33312d4a60b3e607 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Tue, 11 Jun 2019 10:13:36 +0200 Subject: [PATCH] Fix mouse cursor movement in 'select-frame-set-input-focus' (Bug#36165) * lisp/frame.el (select-frame-set-input-focus): With 'mouse-autoselect-window' use 'set-mouse-pixel-position' to avoid selecting another window manager window (Bug#36165). --- lisp/frame.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/frame.el b/lisp/frame.el index a8c230cb7b2..7b61003c9ac 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -979,10 +979,11 @@ recently selected windows nor the buffer list." ;; Move mouse cursor if necessary. (cond (mouse-autoselect-window - (let ((edges (window-inside-edges (frame-selected-window frame)))) + (let ((edges (window-edges (frame-selected-window frame) + t nil t))) ;; Move mouse cursor into FRAME's selected window to avoid that ;; Emacs mouse-autoselects another window. - (set-mouse-position frame (nth 2 edges) (nth 1 edges)))) + (set-mouse-pixel-position frame (1- (nth 2 edges)) (nth 1 edges)))) (focus-follows-mouse ;; Move mouse cursor into FRAME to avoid that another frame gets ;; selected by the window manager. -- 2.39.2