summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el21
1 files changed, 14 insertions, 7 deletions
diff --git a/corfu.el b/corfu.el
index c0f41a9..ce06ac4 100644
--- a/corfu.el
+++ b/corfu.el
@@ -491,14 +491,21 @@ FRAME is the existing frame."
;; Mark window as dedicated to prevent frame reuse (gh:minad/corfu#60)
(set-window-dedicated-p win t))
(redirect-frame-focus frame parent)
- (pcase-let ((`(,px . ,py) (frame-position frame)))
+ (pcase-let* ((`(,ox ,oy ,right ,bottom) (frame-edges frame 'outer-edges))
+ (border (* 2 corfu-border-width))
+ (ow (- (- right ox) left-fringe-width right-fringe-width border))
+ (oh (- (- bottom oy) border))
+ (pos-change (or (/= x ox) (/= y oy)))
+ (size-change (or (/= ow width) (/= oh height))))
(cond
- ((and (= x px) (= y py)) (set-frame-size frame width height t))
- ;; New Emacs 31 function for faster resizing/movement in one go.
- ((fboundp 'set-frame-size-and-position-pixelwise)
- (set-frame-size-and-position-pixelwise frame width height x y))
- (t (set-frame-size frame width height t)
- (set-frame-position frame x y)))))
+ ((and pos-change size-change)
+ ;; New Emacs 31 function for faster resizing/movement in one go.
+ (static-if (fboundp 'set-frame-size-and-position-pixelwise)
+ (set-frame-size-and-position-pixelwise frame width height x y)
+ (set-frame-size frame width height t)
+ (set-frame-position frame x y)))
+ (pos-change (set-frame-position frame x y))
+ (size-change (set-frame-size frame width height t)))))
(make-frame-visible frame)
;; Unparent child frame if EXWM is used, otherwise EXWM buffers are drawn on
;; top of the Corfu child frame.