From 06221a2462263631e91c0ad2176dd68fb7edabe8 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Fri, 11 Aug 2023 15:44:11 -0800 Subject: [PATCH] Actually implement deleting/hiding posframes --- notibox.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/notibox.el b/notibox.el index ce9334c..31195a3 100644 --- a/notibox.el +++ b/notibox.el @@ -103,12 +103,17 @@ (defun notibox--hide (frame) "Stop showing FRAME." - (posframe-hide "*notibox*")) + (posframe-hide (window-buffer (frame-selected-window frame)))) (defun notibox-delete (frame) - ;; TODO: if parent, hide all. Otherwise just the one. - (notibox--hide (car notibox-current-posframes)) + "Delete the notibox FRAME. + +If FRAME is the root Emacs window, or some other symbol, hide all notiboxes." + (if (and (framep frame) (not (frame-parent frame))) + (delete-frame frame) + (notibox--hide (car notibox-current-posframes))) (pop notibox-current-posframes)) +;; (frame-parent (selected-frame)) ;=> nil (defun notibox--tail-echoarea () "Show `current-message' in the notibox. If that does not exist, probably hide it."