From b44955841a301f4930b054e912fa4c1a700d426d Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 7 Apr 2020 22:12:43 +0800 Subject: [PATCH] Exclude child frames while calculating window numbers. --- doom-modeline-segments.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 9c016502..805aa51e 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -1364,8 +1364,14 @@ one. The ignored buffers are excluded unless `aw-ignore-on' is nil." (window-numbering-get-number-string)) (t "")))) (if (and (< 0 (length num)) - (< (if (active-minibuffer-window) 2 1) - (length (cl-mapcan #'window-list (visible-frame-list))))) + (< (if (active-minibuffer-window) 2 1) ; exclude minibuffer + (length (cl-mapcan + (lambda (frame) + ;; Exclude child frames + (unless (and (fboundp 'frame-parent) + (frame-parent frame)) + (window-list))) + (visible-frame-list))))) (propertize (format " %s " num) 'face (if (doom-modeline--active) 'doom-modeline-buffer-major-mode