From 65e7e7f42dc07012560b9fbd9a1f0fe91e8949be Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 14 Dec 2023 08:32:06 +0200 Subject: [PATCH] mu4e-compose: be less eager deleting frames We were deleting frames if it was not the last one; however, emacs can have a bunch of hidden frames (for tooltips?) that we should not consider. --- mu4e/mu4e-compose.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 66a8b8f6..334c2571 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -586,8 +586,8 @@ buffers; lets remap its faces so it uses the ones for mu4e." (delete-region (point-min) (point-max)))) (defun mu4e--decoded-message (msg &optional headers-only) - "Get the headers part of message MSG, decoded as a string. -This is used only to extract header information." + "Get the message MSG, decoded as a string. +With HEADERS-ONLY non-nil, only include the headers part." (with-temp-buffer (setq-local gnus-article-decode-hook '(article-decode-charset @@ -750,8 +750,14 @@ Is this address yours?" (defun mu4e--maybe-delete-frame () "Delete frame if there are multiple and current one has a single window." - (when (and (one-window-p) (> (length (frame-list)) 1)) - (delete-frame))) + ;; Only consider _real_ frames with some size + (when (one-window-p) + (let ((real-frames + (seq-filter (lambda (frame) + (> (or (frame-parameter frame 'width) 0) 0)) + (frame-list)))) + (when (> (length real-frames) 1) + (delete-frame))))) (defun mu4e--compose-setup (compose-type compose-func &optional switch) "Set up a new buffer for mu4e message composition.