doom-modeline
doom-modeline copied to clipboard
Modeline not working as expected when mouse hover a frame in an out
Thank you for the bug report
- [X] I am using the latest version of
doom-modeline
related packages. - [X] I checked FAQ.
- [X] You may also try reproduce the issue using clean environment and minimal configurations with
the command
emacs -Q
.
Bug description
Probably this bug only happens in Linux (GTK) and maybe only with specific Windows Managers. I'm using Qtile as Window Manager.
The bug is the following: moving the mouse out of a frame leaves the modeline in a half-state (active-inactive) and it behaves different if the the mouse hovers another Emacs frame or a different App.
Pictures:
- Moving mouse from Frame 1 to different App:
- Moving mouse from Frame 1 to Frame 2:
- Moving mouse from Frame 1 to Frame 2 then clicking on Frame 2 (modeline looks good in this case, but a click is needed)
Steps to reproduce
Use doom-emacs and a tiling windows manager.
Expected behavior
When focus is lost on a frame the modeline should be inactive. When focus is gain on a frame the modeline should be fully active (not needing an extra click).
OS
Linux
Emacs Version
29 (gccemacs-dev)
Emacs Configurations
Doom Emacs
Error callstack
No response
Anything else
No response
Please try (advice-add #'select-window :after #'force-mode-line-update)
and/or (add-function :after after-focus-change-function #'force-mode-line-update)
.
Please try
(advice-add #'select-window :after #'force-mode-line-update)
and/or(add-function :after after-focus-change-function #'force-mode-line-update)
.
Something not working as it should with: (advice-add #'select-window :after #'force-mode-line-update)
apply: Wrong number of arguments: #<subr force-mode-line-update>, 2
In any case, force-mode-line-update
does not fix the problem, is there a way to trigger the mouse-click event?
No idea what happen to your WM. Try this snippet
(advice-add #'select-window :after (lambda (&rest _) (force-mode-line-update)))
(advice-add #'handle-switch-frame :after #'doom-modeline-set-selected-window)
(add-function :after after-focus-change-function #'doom-modeline-set-selected-window)
No idea what happen to your WM. Try this snippet
(advice-add #'select-window :after (lambda (&rest _) (force-mode-line-update))) (advice-add #'handle-switch-frame :after #'doom-modeline-set-selected-window) (add-function :after after-focus-change-function #'doom-modeline-set-selected-window)
No luck with the snippet above :(.
Adding this one:
(defun do-click ()
(interactive)
(mouse-set-point 'click nil))
(global-set-key (kbd "<f9>") 'do-click)
When I press <f9>
it fixes the modeline but there are still issues when the frame loses the focus (modeline not getting the inactive face)
I think it's related to Emacs 29 and/or WM. I tested on macOS 12.5, Windows 10/11, Ubuntu KDE/Mate, Linux Mint Cinnamon, etc. It's working well. It seems face remapping is not working in your env. How about vanilla Emacs (emacs -Q
)?
I think it's related to Emacs 29 and/or WM. I tested on macOS 12.5, Windows 10/11, Ubuntu KDE/Mate, Linux Mint Cinnamon, etc. It's working well. It seems face remapping is not working in your env. How about vanilla Emacs (
emacs -Q
)?
If you mean the default modeline without any extra configuration, that works as expected.
Vanilla Emacs + doom-modeline is something I haven't tried yet.
Yes. I mean Vanilla Emacs + doom-modeline
.
Ok, I confirm Vanilla Emacs + doom-modeline
works as expected, I'll try to find out what is causing the issues in doom
.
Thank you @seagle0128