emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/posframe 13d756d 10/13: Merge pull request #55 from ttt


From: Feng Shu
Subject: [elpa] externals/posframe 13d756d 10/13: Merge pull request #55 from tttuuu888/work-redirect-focus
Date: Sun, 5 Apr 2020 07:58:04 -0400 (EDT)

branch: externals/posframe
commit 13d756d6a6614e934316be92cee2eb10bc6d4b3f
Merge: 304c298 6ddf9c3
Author: tumashu <address@hidden>
Commit: GitHub <address@hidden>

    Merge pull request #55 from tttuuu888/work-redirect-focus
    
    posframe.el (posframe--redirect-posframe-focus): simplify
---
 posframe.el | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/posframe.el b/posframe.el
index b5cc2c4..8015b19 100644
--- a/posframe.el
+++ b/posframe.el
@@ -595,19 +595,11 @@ You can use `posframe-delete-all' to delete all 
posframes."
             (cons position height))
       height)))
 
-(defvar posframe--previous-frame nil)
-
 (defun posframe--redirect-posframe-focus ()
-  "Redirect focus from the posframe to the previous frame. This prevents the
+  "Redirect focus from the posframe to the parent frame. This prevents the
 posframe from catching keyboard input if the window manager selects it."
-  (interactive)
-  (if (eq (selected-frame) posframe--frame)
-      (when posframe--previous-frame
-        (redirect-frame-focus posframe--frame posframe--previous-frame))
-    (progn
-      (setf posframe--previous-frame (selected-frame))
-      (when posframe--frame
-        (redirect-frame-focus posframe--frame posframe--previous-frame)))))
+  (when (eq (selected-frame) posframe--frame)
+    (redirect-frame-focus posframe--frame (frame-parent))))
 
 (add-hook 'focus-in-hook #'posframe--redirect-posframe-focus)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]