From a98c8f5a098cf646c282be67cce9fb7999d353d7 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 10 Mar 2020 01:39:05 +0200 Subject: [PATCH] Improve new-frame logic of windmove-display-in-direction (bug#39875) * lisp/windmove.el (windmove-display-in-direction): For frame-based logic use code similar to display-buffer-pop-up-frame. --- lisp/windmove.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/windmove.el b/lisp/windmove.el index 94d2b75210d..f96383197bd 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -475,10 +475,14 @@ When `switch-to-buffer-obey-display-actions' is non-nil, (setq type 'tab) (selected-window)) ((eq dir 'new-frame) - (window--maybe-raise-frame - (make-frame-on-current-monitor pop-up-frame-alist)) - (setq type 'frame) - (selected-window)) + (let* ((params (cdr (assq 'pop-up-frame-parameters alist))) + (pop-up-frame-alist (append params pop-up-frame-alist)) + (frame (make-frame-on-current-monitor + pop-up-frame-alist))) + (unless (cdr (assq 'inhibit-switch-frame alist)) + (window--maybe-raise-frame frame)) + (setq type 'frame) + (frame-selected-window frame))) ((eq dir 'same-window) (selected-window)) (t (window-in-direction -- 2.39.2