Improve posframe/modeline focus fix
switch-to-buffer is more reliable than select-window
This commit is contained in:
parent
3131bda98c
commit
01dcc248cf
1 changed files with 4 additions and 6 deletions
|
@ -13,13 +13,11 @@ bottom, which is easier on the eyes on big displays."
|
||||||
2)))))
|
2)))))
|
||||||
|
|
||||||
(defvar +helm--posframe-buffer nil)
|
(defvar +helm--posframe-buffer nil)
|
||||||
(defvar +helm--posframe-last-window nil)
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +helm-posframe-display (buffer &optional _resume)
|
(defun +helm-posframe-display (buffer &optional _resume)
|
||||||
"TODO"
|
"TODO"
|
||||||
(require 'posframe)
|
(require 'posframe)
|
||||||
(setq +helm--posframe-last-window (selected-window)
|
(setq helm--buffer-in-new-frame-p t)
|
||||||
helm--buffer-in-new-frame-p t)
|
|
||||||
(posframe-show
|
(posframe-show
|
||||||
(setq +helm--posframe-buffer buffer)
|
(setq +helm--posframe-buffer buffer)
|
||||||
:position (point)
|
:position (point)
|
||||||
|
@ -33,9 +31,9 @@ bottom, which is easier on the eyes on big displays."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +helm|posframe-cleanup ()
|
(defun +helm|posframe-cleanup ()
|
||||||
"TODO"
|
"TODO"
|
||||||
;; Ensure the underlying window is switched to, to ensure that frame is given
|
;; Ensure focus is properly returned to the underlying window, by forcing a
|
||||||
;; proper focus; this gives the modeline a chance to refresh.
|
;; chance in buffer/window focus. This gives the modeline a chance to refresh.
|
||||||
(select-window +helm--posframe-last-window)
|
(switch-to-buffer +helm--posframe-buffer t)
|
||||||
;;
|
;;
|
||||||
(posframe-delete +helm--posframe-buffer))
|
(posframe-delete +helm--posframe-buffer))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue