I've been looking through the available hooks, but none of them seems to be firing when you switch windows.
What I'm trying to do, is activating a minor mode for the selected window:
(defvar active-window (frame-selected-window))
(defun active-window-switch (&rest _)
(when active-window
(with-selected-window active-window
(active-window-mode nil)))
(setq active-window (frame-selected-window))
(active-window-mode t))
(define-minor-mode active-window-mode
"Minor mode to distinguish the selected window."
:global nil :group 'active-window :init-value nil :lighter " Active")
(add-hook 'window-configuration-change-hook #'active-window-switch)
(provide 'active-window)
What hook or function to advice can I use instead of window-configuration-change-hook
(which only fires when I create or quit windows)?