[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/posframe 610cc18 1/2: Always run posframe--mouse-banish
From: |
ELPA Syncer |
Subject: |
[elpa] externals/posframe 610cc18 1/2: Always run posframe--mouse-banish. |
Date: |
Tue, 9 Nov 2021 05:57:24 -0500 (EST) |
branch: externals/posframe
commit 610cc18f02698a0ced1a28b451062039f4d5d0f2
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Always run posframe--mouse-banish.
* posframe.el (posframe-show): Alway run posframe--mouse-banish.
(posframe--mouse-banish): Handle m-x and m-y are nil.
---
posframe.el | 47 ++++++++++++++++++++++++-----------------------
1 file changed, 24 insertions(+), 23 deletions(-)
diff --git a/posframe.el b/posframe.el
index 7e7fb38..937b165 100644
--- a/posframe.el
+++ b/posframe.el
@@ -679,28 +679,28 @@ You can use `posframe-delete-all' to delete all
posframes."
(cons parent-buffer-name parent-buffer)))
;; Mouse banish
- (when (and (car mouse-position)
- (cdr mouse-position))
- (posframe--mouse-banish
- (list :parent-frame parent-frame
- :mouse-x (+ (or (car ref-position) 0)
- (car mouse-position))
- :mouse-y (+ (or (cdr ref-position) 0)
- (cdr mouse-position))
- :posframe-x
- (if (>= (car position) 0)
- (car position)
- (- (frame-pixel-width parent-frame)
- (frame-pixel-width posframe)))
- :posframe-y
- (if (>= (cdr position) 0)
- (cdr position)
- (- (frame-pixel-height parent-frame)
- (frame-pixel-height posframe)))
- :posframe-width (frame-pixel-width posframe)
- :posframe-height (frame-pixel-height posframe)
- :parent-frame-width parent-frame-width
- :parent-frame-height parent-frame-height)))
+ (posframe--mouse-banish
+ (list :parent-frame parent-frame
+ :mouse-x (when (car mouse-position)
+ (+ (or (car ref-position) 0)
+ (car mouse-position)))
+ :mouse-y (when (cdr mouse-position)
+ (+ (or (cdr ref-position) 0)
+ (cdr mouse-position)))
+ :posframe-x
+ (if (>= (car position) 0)
+ (car position)
+ (- (frame-pixel-width parent-frame)
+ (frame-pixel-width posframe)))
+ :posframe-y
+ (if (>= (cdr position) 0)
+ (cdr position)
+ (- (frame-pixel-height parent-frame)
+ (frame-pixel-height posframe)))
+ :posframe-width (frame-pixel-width posframe)
+ :posframe-height (frame-pixel-height posframe)
+ :parent-frame-width parent-frame-width
+ :parent-frame-height parent-frame-height))
;; Return posframe
posframe)))
@@ -736,7 +736,8 @@
https://github.com/tumashu/posframe/issues/4#issuecomment-357514918"
(h (plist-get info :posframe-height))
(p-w (plist-get info :parent-frame-width))
(p-h (plist-get info :parent-frame-height)))
- (when (and (>= m-x x)
+ (when (and m-x m-y
+ (>= m-x x)
(<= m-x (+ x w))
(>= m-y y)
(<= m-y (+ y h)))