emacs-devel
[Top][All Lists]
Advanced

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

RE: address@hidden: mouse-autoselect-window needs a de lay]


From: Marshall, Simon
Subject: RE: address@hidden: mouse-autoselect-window needs a de lay]
Date: Thu, 6 Jul 2006 12:43:54 +0100

> Please try the attached patch - it's based on Stefan's 
> suggestion to use `handle-select-window'.  martin.

Hi Martin, thanks, I can play with the lisp now.

One problem I see with this implementation is that it also waits for twice
the delay.  The reason can be seen in the sequence of events when the mouse
is moved to a new window:

- handle-select-window calls autoselect-window-start.

- autoselect-window-start sets autoselect-window-position to
(mouse-position).  However, this position appears to be the position
*before* the mouse movement.

- autoselect-window-start starts a timer to run autoselect-window-select
after the specified delay.

- when autoselect-window-select runs after the first timeout, it checks to
see if autoselect-window-position is equal to (mouse-position), which cannot
be true even if the mouse has not moved again.  So, window selection does
not occur, and it just sets autoselect-window-position to (mouse-position).

- when autoselect-window-select runs after the second timeout, and the mouse
has not moved, autoselect-window-position is equal to (mouse-position) and
window selection occurs.

To be honest, I'd be quite happy with the feature if it did not try to
detect for a quiescent mouse as it would still be a big improvement.  In
that case I guess the implementation would not need to use (mouse-position)
and the above problem would not occur.

If it could be made to work, it would be a bonus (though perhaps should be
an additional option, i.e., delay or delay with quiescence).  Of course, one
simple hack/workaround would be to use (/ mouse-autoselect-window 2.0) for
the timer delay, though I'd be interested to see why mouse-position returns
what it does.

Simon.




reply via email to

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