diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-12-29 17:31:09 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-12-29 17:40:14 +0100 |
| commit | 497c8534a267ec39ca80c7e27e70fca48c73563c (patch) | |
| tree | df671d1855e642ea29d6ffbbfce2d5acea32bd7d | |
| parent | cbeab25d40e3b62e622847a2840c6676cd7cfece (diff) | |
Use internal-border-width instead of child-frame-border-width
| -rw-r--r-- | corfu.el | 15 | ||||
| -rw-r--r-- | extensions/corfu-popupinfo.el | 4 |
2 files changed, 8 insertions, 11 deletions
@@ -325,7 +325,8 @@ See also the settings `corfu-auto-delay', `corfu-auto-prefix' and (min-width . t) (min-height . t) (border-width . 0) - (child-frame-border-width . 1) + (outer-border-width . 0) + (internal-border-width . 1) (left-fringe . 0) (right-fringe . 0) (vertical-scroll-bars . nil) @@ -467,10 +468,9 @@ FRAME is the existing frame." ;; Check before applying the setting. Without the check, the frame flickers ;; on Mac. We have to apply the face background before adjusting the frame ;; parameter, otherwise the border is not updated. - (let* ((face (if (facep 'child-frame-border) 'child-frame-border 'internal-border)) - (new (face-attribute 'corfu-border :background nil 'default))) - (unless (equal (face-attribute face :background frame 'default) new) - (set-face-background face new frame))) + (let ((new (face-attribute 'corfu-border :background nil 'default))) + (unless (equal (face-attribute 'internal-border :background frame 'default) new) + (set-face-background 'internal-border new frame))) ;; Reset frame parameters if they changed. For example `tool-bar-mode' ;; overrides the parameter `tool-bar-lines' for every frame, including child ;; frames. The child frame API is a pleasure to work with. It is full of @@ -480,9 +480,6 @@ FRAME is the existing frame." (lambda (p) (equal (alist-get (car p) params) (cdr p))) `((background-color . ,(face-attribute 'corfu-default :background nil 'default)) - ;; Set `internal-border-width' for Emacs 27 - (internal-border-width - . ,(alist-get 'child-frame-border-width corfu--frame-parameters)) (font . ,(frame-parameter parent 'font)) ,@corfu--frame-parameters)))) (modify-frame-parameters frame reset)) @@ -1027,7 +1024,7 @@ A scroll bar is displayed from LO to LO+BAR." ;; parent frame (gh:minad/corfu#261). (height (max lh (* (length lines) ch))) (edge (window-inside-pixel-edges)) - (border (alist-get 'child-frame-border-width corfu--frame-parameters)) + (border (alist-get 'internal-border-width corfu--frame-parameters)) (x (max 0 (min (+ (car edge) (- (or (car pos) 0) ml (* cw off) border)) (- (frame-pixel-width) width)))) (yb (+ (cadr edge) (window-tab-line-height) (or (cdr pos) 0) lh)) diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el index 803728a..8ec30d8 100644 --- a/extensions/corfu-popupinfo.el +++ b/extensions/corfu-popupinfo.el @@ -288,7 +288,7 @@ form (X Y WIDTH HEIGHT DIR)." (pcase-let* ((cw (default-font-width)) (lh (default-line-height)) - (border (alist-get 'child-frame-border-width corfu--frame-parameters)) + (border (alist-get 'internal-border-width corfu--frame-parameters)) (`(,_pfx ,_pfy ,pfw ,pfh) (corfu-popupinfo--frame-geometry (frame-parent corfu--frame))) (`(,cfx ,cfy ,cfw ,cfh) (corfu-popupinfo--frame-geometry corfu--frame)) @@ -358,7 +358,7 @@ form (X Y WIDTH HEIGHT DIR)." (corfu-popupinfo--hide) (setq cand-changed nil coords-changed nil))) (when (or cand-changed coords-changed) - (pcase-let* ((border (alist-get 'child-frame-border-width corfu--frame-parameters)) + (pcase-let* ((border (alist-get 'internal-border-width corfu--frame-parameters)) (`(,area-x ,area-y ,area-w ,area-h ,area-d) (corfu-popupinfo--area (if cand-changed |
