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

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

[elpa] externals/which-key f6ce67d 05/10: Get which-key--buffer's window


From: Stefan Monnier
Subject: [elpa] externals/which-key f6ce67d 05/10: Get which-key--buffer's window from any frame
Date: Wed, 2 Jun 2021 18:29:40 -0400 (EDT)

branch: externals/which-key
commit f6ce67d7053d00e11e0eda653e2f39d7955fb3b4
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Get which-key--buffer's window from any frame
    
    Previously we assumed the buffer was being displayed in a window
    of the current frame, which isn't the case if e.g. a child frame
    is being used.
    
    We also cannot assume that the third-party code that sets up such
    a child frame also deletes it.  `which-key-posframe' for example
    merely hides it.
---
 which-key.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/which-key.el b/which-key.el
index 3f5f809..74accfa 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1175,7 +1175,10 @@ popup)."
 
 (defun which-key--popup-showing-p ()
   (and (bufferp which-key--buffer)
-       (window-live-p (get-buffer-window which-key--buffer))))
+       (or (window-live-p (get-buffer-window which-key--buffer))
+          (let ((window (get-buffer-window which-key--buffer t)))
+            (and (window-live-p window)
+                 (frame-visible-p (window-frame window)))))))
 
 (defun which-key--show-popup (act-popup-dim)
   "Show the which-key buffer.



reply via email to

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