diff options
| author | Feng Shu <tumashu@163.com> | 2021-04-09 11:59:46 +0800 |
|---|---|---|
| committer | Feng Shu <tumashu@163.com> | 2021-04-09 11:59:46 +0800 |
| commit | a8a304b74d52ecfd6a2a0b0e21e018b749b47e4c (patch) | |
| tree | 38934e182a5a464c336e393f04e4aeb419661ad5 | |
| parent | 755562e0a94091801bdfe86df1e2197bdb0b815d (diff) | |
* ivy-posframe.el (ivy-posframe-refposhandler-default): use exwm info to get ref position.
| -rw-r--r-- | ivy-posframe.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ivy-posframe.el b/ivy-posframe.el index 114315e..67b07b3 100644 --- a/ivy-posframe.el +++ b/ivy-posframe.el @@ -245,7 +245,10 @@ This variable is useful for `ivy-posframe-read-action' .") ;; Fix warn (defvar emacs-basic-display) (defvar ivy--display-function) + (defvar exwm--connection) +(defvar exwm-workspace--workareas) +(defvar exwm-workspace-current-index) (defun ivy-posframe-refposhandler-default (&optional frame) "The default posframe refposhandler used by ivy-posframe." @@ -253,10 +256,15 @@ This variable is useful for `ivy-posframe-read-action' .") ;; EXWM environment (exwm--connection (or (ignore-errors - ;; Need user install xwininfo. + (let ((info (elt exwm-workspace--workareas + exwm-workspace-current-index))) + (cons (elt info 0) + (elt info 1)))) + ;; Need user install xwininfo. + (ignore-errors (posframe-refposhandler-xwininfo frame)) - ;; FIXME: maybe exwm provide some function, - ;; Which can get top-left of emacs. + ;; Fallback, this value will incorrect sometime, for example: user + ;; have panel. (cons 0 0))) (t nil))) |
