branch: externals/corfu
commit 737720ff795a2b0acdd6fecedfc02588e715a9cd
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    corfu--make-frame: Store corfu--geometry frame parameter
---
 corfu.el | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/corfu.el b/corfu.el
index 64c05554734..41cec09d495 100644
--- a/corfu.el
+++ b/corfu.el
@@ -479,6 +479,7 @@ FRAME is the existing frame."
     ;; lovely surprises.
     (let* ((win (frame-root-window frame))
            (is (frame-parameters frame))
+           (params `((corfu--geometry ,x ,y ,width ,height) ,@params))
            (diff (cl-loop for p in params for (k . v) = p
                           unless (equal (alist-get k is) v) collect p)))
       (when diff (modify-frame-parameters frame diff))
@@ -489,24 +490,21 @@ FRAME is the existing frame."
       (set-window-parameter win 'no-delete-other-windows t)
       (set-window-parameter win 'no-other-window t)
       ;; 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* ((`(,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 pos-change size-change)
-        ;; TODO: New Emacs 31 function for faster resizing/movement in one go.
-        ;; Add this function to Compat 31 as backport.
-        (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)))))
+      (set-window-dedicated-p win t)
+      (redirect-frame-focus frame parent)
+      (pcase-let* ((`(,ox ,oy ,ow ,oh) (alist-get 'corfu--geometry is '(0 0 0 
0)))
+                   (pos-change (or (/= x ox) (/= y oy)))
+                   (size-change (or (/= ow width) (/= oh height))))
+        (cond
+         ((and pos-change size-change)
+          ;; TODO: New Emacs 31 function for faster resizing/movement in one 
go.
+          ;; Add this function to Compat 31 as backport.
+          (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.

Reply via email to