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

From: Richard Copley <[email-masked]>
Date: Sat, 1 Oct 2016 11:30:06 +0100

On 1 October 2016 at 09:44, martin rudalics <[email-masked]> wrote:
>>> 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:

Yes.

> Is there
> anything in your scenario that contradicts what has been written there?

I don't think so.

>> 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.

It's the one showing frame 2, as I said.

> 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.

Here, after typing M-x in *scratch* in the recipe:
* if I type C-x o the activated window does not change;
* if I type C-x 5 o the activated window does change.

Is that the visible difference you mean?

>  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.

It's not wrong until you type Alt-Tab.

>> > 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?

Possibly.

Typing Alt-Tab several times switches the window-manager's activation
between frame 1 and frame 2 (and other windows that may be present
if you hold Alt and type Tab more than once). I can switch activation between
the two Emacs windows and any other windows as much as I like, as
evidenced by the title-bar painting style.

But no amount of typing Alt-Tab changes which Emacs window contains
the solid flashing cursor where text is inserted when I type characters.

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

Whichever one you want.

>> nor by clicking on the non-client area of frame
>> > 1
>
> But you already are in frame 1.  What should that click accomplish?

Firstly, no, I'm in frame 2.

Secondly, I'm saying that any amount of switching between windows,
either using Alt-Tab, or by clicking on title bars, makes no difference
to the window where text is inserted.

>> In fact I hadn't tried C-x 5 o. That does fix things.
>
> Anything doing C-x o repeatedly wouldn't fix?

Yes.

>>>> 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.

I have tried to do that.
Thanks.