[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/posframe 087a7fc 02/13: Merge pull request #54 from def
From: |
Feng Shu |
Subject: |
[elpa] externals/posframe 087a7fc 02/13: Merge pull request #54 from defaultxr/master |
Date: |
Sun, 5 Apr 2020 07:58:03 -0400 (EDT) |
branch: externals/posframe
commit 087a7fc3c8ba9e9faa3fea2d5404d163b3e31c2f
Merge: 9638b9d 5dc3da4
Author: tumashu <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #54 from defaultxr/master
prevent posframes from getting keyboard input
---
posframe.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/posframe.el b/posframe.el
index cd0998b..6ca264d 100644
--- a/posframe.el
+++ b/posframe.el
@@ -595,6 +595,22 @@ 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
+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)))))
+
+(add-hook 'focus-in-hook #'posframe--redirect-posframe-focus)
+
(defun posframe--mouse-banish (frame)
"Banish mouse to the (0 . 0) of FRAME.
FIXME: This is a hacky fix for the mouse focus problem, which like:
- [elpa] externals/posframe updated (9638b9d -> 8db9302), Feng Shu, 2020/04/05
- [elpa] externals/posframe a568d9f 03/13: * posframe.el (posframe-mouse-banish): default to nil., Feng Shu, 2020/04/05
- [elpa] externals/posframe bd94c0e 11/13: * posframe.el (posframe-mouse-banish): Update docstring, Feng Shu, 2020/04/05
- [elpa] externals/posframe 5dc3da4 01/13: prevent posframes from getting keyboard input, Feng Shu, 2020/04/05
- [elpa] externals/posframe 6ddf9c3 06/13: Remove no longer used variable, Feng Shu, 2020/04/05
- [elpa] externals/posframe 4ff106e 08/13: Merge pull request #57 from tsuu32/fix/refresh-fit, Feng Shu, 2020/04/05
- [elpa] externals/posframe 33ad4ac 07/13: Fix incorrect posframe size after posframe-refresh, Feng Shu, 2020/04/05
- [elpa] externals/posframe 087a7fc 02/13: Merge pull request #54 from defaultxr/master,
Feng Shu <=
- [elpa] externals/posframe 304c298 09/13: Revert "* posframe.el (posframe-mouse-banish): default to nil.", Feng Shu, 2020/04/05
- [elpa] externals/posframe c15800a 12/13: * posframe.el (posframe-mouse-banish): Fix previous commit, Feng Shu, 2020/04/05
- [elpa] externals/posframe 13d756d 10/13: Merge pull request #55 from tttuuu888/work-redirect-focus, Feng Shu, 2020/04/05
- [elpa] externals/posframe 98587de 05/13: posframe.el (posframe--redirect-posframe-focus): simplify, Feng Shu, 2020/04/05
- [elpa] externals/posframe 8a9af54 04/13: * posframe.el (posframe-show): let posframe-show returns the frame, Feng Shu, 2020/04/05
- [elpa] externals/posframe 8db9302 13/13: Support tab-line, Feng Shu, 2020/04/05