Subject: bug#16874: 24.3.50; Regression in active window detection

From: Eli Zaretskii <[email-masked]>
Date: Tue, 25 Feb 2014 18:18:09 +0200

> From: Damien Cassou <[email-masked]>
> Date: Tue, 25 Feb 2014 10:06:49 +0100
> 
> 
> The following piece of code, from the milkypostman/powerline github
> repository, used to detect if the current window is active or not:
> 
>     (defun powerline-selected-window-active ()
>       "Return whether the current window is active."
>       (or (eq (frame-selected-window)
>               (selected-window))
>           (and (minibuffer-window-active-p
>                 (frame-selected-window))
>                (eq (pl/minibuffer-selected-window)
>                    (selected-window)))))
> 
> This works fine in released Emacs 24 but does not work anymore in
> emacs-snapshot (see below for details about the version I used to test).
> Is this an Emacs regression or a problem in the implementation of this
> function that is revealed by some recent changes in Emacs?

It's a deliberate change in Emacs that breaks functions which assume
that the window whose mode line is being redrawn is selected at that
time.