emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu 391a4870fe: Extract corfu--gtk-resize-child-frame


From: ELPA Syncer
Subject: [elpa] externals/corfu 391a4870fe: Extract corfu--gtk-resize-child-frames (Fix #282)
Date: Thu, 29 Dec 2022 22:57:28 -0500 (EST)

branch: externals/corfu
commit 391a4870fee9cdcd0fdecfa468e2726fd670e5e1
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Extract corfu--gtk-resize-child-frames (Fix #282)
---
 corfu.el | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/corfu.el b/corfu.el
index bfba9c9d0c..ddde4256fd 100644
--- a/corfu.el
+++ b/corfu.el
@@ -366,8 +366,22 @@ The completion backend can override this with
       (cl-pushnew 'corfu-default (alist-get 'default face-remapping-alist))
       buffer)))
 
-;; Function adapted from posframe.el by tumashu
 (defvar x-gtk-resize-child-frames) ;; Not present on non-gtk builds
+(defvar corfu--gtk-resize-child-frames
+  (let ((case-fold-search t))
+    (and
+     ;; XXX HACK to fix resizing on gtk3/gnome taken from posframe.el
+     ;; More information:
+     ;; * https://github.com/minad/corfu/issues/17
+     ;; * https://gitlab.gnome.org/GNOME/mutter/-/issues/840
+     ;; * https://lists.gnu.org/archive/html/emacs-devel/2020-02/msg00001.html
+     (string-match-p "gtk3" system-configuration-features)
+     (string-match-p "gnome\\|cinnamon"
+                     (or (getenv "XDG_CURRENT_DESKTOP")
+                         (getenv "DESKTOP_SESSION") ""))
+     'resize-mode)))
+
+;; Function adapted from posframe.el by tumashu
 (defun corfu--make-frame (frame x y width height buffer)
   "Show BUFFER in child frame at X/Y with WIDTH/HEIGHT.
 FRAME is the existing frame."
@@ -378,19 +392,7 @@ FRAME is the existing frame."
   (let* ((window-min-height 1)
          (window-min-width 1)
          (inhibit-redisplay t)
-         (x-gtk-resize-child-frames
-          (let ((case-fold-search t))
-            (and
-             ;; XXX HACK to fix resizing on gtk3/gnome taken from posframe.el
-             ;; More information:
-             ;; * https://github.com/minad/corfu/issues/17
-             ;; * https://gitlab.gnome.org/GNOME/mutter/-/issues/840
-             ;; * 
https://lists.gnu.org/archive/html/emacs-devel/2020-02/msg00001.html
-             (string-match-p "gtk3" system-configuration-features)
-             (string-match-p "gnome\\|cinnamon"
-                             (or (getenv "XDG_CURRENT_DESKTOP")
-                                 (getenv "DESKTOP_SESSION") ""))
-             'resize-mode)))
+         (x-gtk-resize-child-frames corfu--gtk-resize-child-frames)
          (after-make-frame-functions)
          (parent (window-frame)))
     (unless (and (frame-live-p frame)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]