Subject: Re: bug#24500: 25.1.50; Can't other-window from minibuffer if Ediff control panel frame present

From: martin rudalics <[email-masked]>
Date: Sat, 01 Oct 2016 10:44:38 +0200

>> Why do you think so?  The selected frame is frame 1 ever since C-x o
 >> selected it (and it did so twice in a row).
 >
 > OK, then I now realize I have no idea what "selected frame" means.

Did you read section "28.10 Input Focus" of the Elisp manual: Is there
anything in your scenario that contradicts what has been written there?

 > The fact I was attempting to express is that the activated window
 > at the window-manager level is frame 2.

With "activated window at the window-manager level" you mean the window
that has input focus and has its title bar painted differently from
other windows but is not necessarily the topmost window in the Z-order?
That window is here the one showing frame 1 after you switched to it via
C-x o.

Note that there is only one visible difference between C-x 5 o and C-x o
in your scenario: The window selected after C-x 5 o must be on the other
frame.  The window selected after C-x o can be on the same or the other
frame and depends on the cyclic ordering of windows.  In either case the
"The selected window always resides on the selected frame." invariant is
preserved.

There is one Emacs internal difference: While focus is "redirected", the
window for which this happens still gets the selected window's mode-line
appearance.  As a rule, that behavior is always used during minibuffer
input, probably because it would be distracting to change highlighting
after typing M-x.  But keep in mind that the window initially selected
during minibuffer input is the minibuffer window and not that with the
highlighted mode-line - regardless whether the minibuffer window is on
the same frame or another one.

 > >> I'm not sure I understand what you mean here.  Do you mean that C-x 5 o
 > >> after the C-g does not select window2?
 > >
 > > I'd better assume that I don't know what "select window2" means either.
 > >
 > > I mean that the window with the solid flashing cursor where text is inserted
 > > when you type characters is window2,
 >
 > Not window2, sorry. Rather, it's the window displaying *scratch* on frame 1.

But what's wrong with that?  After all you _did_ use C-x o to select
that window.

 > > and that can't be changed by
 > > typing Alt-Tab

Do you mean that on frame 1 you cannot use Alt-Tab to switch to frame 2?

 > (which on this Windows system is not passed to Emacs but
 > > activates a different window),

Which one?

 > nor by clicking on the non-client area of frame
 > > 1

But you already are in frame 1.  What should that click accomplish?

 > In fact I hadn't tried C-x 5 o. That does fix things.

Anything doing C-x o repeatedly wouldn't fix?

 >>> but clicking inside a window on frame 2 does remove
 >>> the redirection and get things back to normal.
 >
 >> What was abnormal before?
 >
 > I have no idea what's normal and what isn't any more :)
 >
 > I had expected activating frame 2 (using the window manager) to let me
 > type characters into window2.

Here at any moment I can use Alt-Tab or the mouse to select any of the
three windows involved in your scenario and continue typing text there.
If this doesn't work on your system please tell me precisely where it
fails.

martin