[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: mouse-autoselect-window

From: Drew Adams
Subject: RE: mouse-autoselect-window
Date: Tue, 18 Sep 2007 07:41:07 -0700

> > I disagree.  I'm running Emacs on GNU/Linux under KDE, I have a
> > click-to-focus policy but also have mouse-autoselect-window set to t,
> > because I want to have autoselection between split windows within a
> > single frame.  I also observe the same behavior that Drew Adams
> > described.
> I'm afraid that autoselection between windows of the same frame only
> is somewhat very difficult to achieve.  The attached patch should
> correct the behavior observed by Drew though.  Could you please try?

Yes and no (for me, on Windows).

It raises the frame, but it does not give it the input focus. I had already
said (on 2007-09-05) that giving focus to the frame at the cost of raising
it was a possibility:

> BTW, `mouse-autoselect-window' _could_ select the mouse window in MS
> Windows, even on another frame, at the cost of also raising that frame -
> just add `select-frame-set-input-focus' to its code. However, I'm not sure
> that is a good idea.  I assume that on GNU/Linux etc. the focus moves but
> the window is not raised - that's the behavior I would prefer, anyway.

I mentioned `select-frame-set-input-focus', whereas you used `raise-frame'.
The effect wrt raising is the same, but your fix does not change the input
focus (for me, on Windows).

I personally think that it would be OK to raise the frame too, if focus
cannot be given to it otherwise, but what would really be desirable is to
give focus to the frame (and window) without raising it. I don't know if
that is always possible (e.g. on MS Windows), but when it is possible, it
is, I think, the appropriate behavior.

Ideally, with customizable options, users would be able to control,
separately, autofocus and autoraise.

I also see another problem with your fix (it might not be due to the fix
itself, however). It doesn't always seem to raise the right frame. I don't
know why. I don't know if others will see the same problem.

If I have a narrow frame on top of a wider frame that has two windows, top
and bottom, then moving the mouse from the bottom window to the top actually
raises the other (narrow) frame, instead of just giving the focus to the top

If frame 2 is directly under frame 1, then moving the mouse from window B to
window A should focus window A, but instead it raises frame 2.

Frame 1:
|           |
|       A   |
|           |
|       B   |

Frame 2:
|     |
|     |
|     |
|     |
|     |

The behavior is actually erratic - sometimes it raises frame 2, sometimes it
does not.

I'd suggest trying with `select-frame-set-input-focus' instead of
`raise-frame'. For me, that DTRT (except that it would be even better to be
able to focus frame input without necessarily also raising it).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]