Subject: Re: bug#13225: 24.3.50; Non-selected window has not mode-line-inactive face

From: Stefan Monnier <[email-masked]>
Date: Thu, 20 Dec 2012 09:03:01 -0500

>> Of course, when we drop frame-local variables this problem
>> will disappear.
>> Maybe we should live with the "selected_frame->selected_window !=
>> selected_window" problem until we get rid of frame-local vars.
> I completely fail to understand how frame-local variables are related to
> the problem at hand :-(

Here's the connection: in order for the redisplay code to use the proper
value of (frame-local) variables, it needs to `select-frame' on the
frame being redisplayed.  Since selected-frame and selected-window
should be kept in sync, this means changing the selected-window as well,
hence the bug where each frame's selected_window is drawn as if it were
the global selected-window (the cursor seems to be unaffected, probably
because drawing the cursor is handled specially, so I suspect this
cursor code does not obey frame-local variables).

Actually, now that I think about it, maybe the right fix is to remove
this ensure_selected_frame.  It would be one more step towards removing
frame-local variables (just like we already disallowed variables that
are both buffer-local and frame-local), but still without removing them
altogether.  After all, I don't think that the existing uses of
frame-local vars affect the redisplay.

I've just made this change.

        Stefan