Commit f07eb85c authored by Noam Postavsky's avatar Noam Postavsky

magit-display-buffer: Don't reselect the same frame

Calling select-frame-set-input-focus on the current frame has unwanted
side-effects, like moving the mouse if mouse-autoselect-window is
non-nil.
parent d4e159f3
......@@ -619,9 +619,11 @@ and `magit-post-display-buffer-hook'."
(run-hooks 'magit-pre-display-buffer-hook))
(let ((window (funcall magit-display-buffer-function buffer)))
(unless magit-display-buffer-noselect
(select-frame-set-input-focus
(window-frame
(select-window window)))))
(let* ((old-frame (selected-frame))
(new-frame (window-frame window)))
(select-window window)
(unless (eq old-frame new-frame)
(select-frame-set-input-focus new-frame)))))
(with-current-buffer buffer
(run-hooks 'magit-post-display-buffer-hook)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment