[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 491e4ec33e 4/4: Revert "corfu--make-frame: Remove
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 491e4ec33e 4/4: Revert "corfu--make-frame: Remove some old child frame hack" |
Date: |
Tue, 20 Jun 2023 09:57:57 -0400 (EDT) |
branch: externals/corfu
commit 491e4ec33ed028172556a21ac43e649eeba36d1f
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Revert "corfu--make-frame: Remove some old child frame hack"
This reverts commit ffca40cacf9155a85a426abe73247f59b8e2a500.
---
corfu.el | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/corfu.el b/corfu.el
index ada515602b..67a157f9d5 100644
--- a/corfu.el
+++ b/corfu.el
@@ -448,9 +448,25 @@ FRAME is the existing frame."
;; Mark window as dedicated to prevent frame reuse (#60)
(set-window-dedicated-p win t))
(redirect-frame-focus frame parent)
- (set-frame-size frame width height t)
- (unless (equal (frame-position frame) (cons x y))
- (set-frame-position frame x y)))
+ ;; XXX HACK: Child frame popup behavior improved on Emacs 29.
+ ;; It seems we may not need the Emacs 27/28 hacks anymore.
+ (if (eval-when-compile (< emacs-major-version 29))
+ (let (inhibit-redisplay)
+ (set-frame-size frame width height t)
+ (if (frame-visible-p frame)
+ ;; XXX HACK Avoid flicker when frame is already visible.
+ ;; Redisplay, wait for resize and then move the frame.
+ (unless (equal (frame-position frame) (cons x y))
+ (redisplay 'force)
+ (sleep-for 0.01)
+ (set-frame-position frame x y))
+ ;; XXX HACK: Force redisplay, otherwise the popup sometimes does
not
+ ;; display content.
+ (set-frame-position frame x y)
+ (redisplay 'force)))
+ (set-frame-size frame width height t)
+ (unless (equal (frame-position frame) (cons x y))
+ (set-frame-position frame x y))))
(make-frame-visible frame)
frame)