emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: mouse-autoselect-window with menu pane


From: martin rudalics
Subject: Re: mouse-autoselect-window with menu pane
Date: Thu, 14 Sep 2006 10:43:44 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Hi Simon

> src/emacs -Q
> (setq mouse-autoselect-window 3) C-x C-e C-x 2
>
> And select the lower window.  Move quickly from the lower window up to the
> menu bar and select the Help menu.  While holding down mouse-1, move quickly
> to the upper window (ie, but off the Help menu pane).  Wait until the
> autoselect timeout has occurred and release mouse-1.  Selection of the upper
> window occurs (presumably it occurred while mouse-1 was down but there was
> no redisplay at that time), rather than selection remaining in the lower
> window.  Selection only seems to happen if the mouse is outside the menu
> pane when the autoselect timeout occurs.

It's the intended behavior:

(1) When you cross the border between lower and upper window the timer
starts (regardless of whether you hold down mouse-1 or not).

(2) When you select the menu nothing happens because pre-command isn't
run and the timer has not fired yet.

(3) When you leave the menu pane you are in the upper window.  When at
this very moment the timer fires the upper window is selected.

You shouldn't get it with a delay of less than one second.  Using a
negative value for `mouse-autoselect-window' should avoid the problem
for the case that you inadvertently leave the menu pane for a short
period.

David Kastrup earlier critized the use of a delay and insofar I agree
with him - the simple delay approach can't DTRT for all possible user
interactions and all possible values of `mouse-autoselect-window'.  You
have to experiment with the values to find out what is most suited for
your system.

> While this might seem fairly innocuous, it bites in the more frequent
> situation where you momentarily leave the menu pane before returning
> to select an entry.  So, instead of releasing mouse-1 after the
> autoselect timeout, move back into the Help menu pane and select About
> Emacs.  The action occurs in the upper window, not the lower window
> which was selected when you opened the Help menu.  So, it seems that
> by being outside the menu pane when the autoselect timeout occurs,
> autoselection is performed.  I think it is sensible to suppress
> autoselection in this case (ie, reschedule the delay).

If I wanted to do this, I'd have to intercept `x_activate_menubar',
detect whether the `mouse-autoselect-window-timer' timer is active, and
kill it.  As a consequenece autoselection would be cancelled as soon as
the user accesses the menubar.  Rescheduling the timer seems hardly
feasible since it would almost certainly break the behavior for users
with a smaller delay.





reply via email to

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