[Top][All Lists]

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

RE: mouse-autoselect-window with menu pane

From: Marshall, Simon
Subject: RE: mouse-autoselect-window with menu pane
Date: Thu, 14 Sep 2006 11:59:02 +0100

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

Hi Martin, I do get this problem with the default 0.5s delay.  At least, I
do see a problem of occasional switching window during menu use.  I found
this particular problem when I upped the delay to 3s to try to make it
easier to reproduce/understand what I was seeing in normal use.  What's
special about 1s?

I'm not sure what you mean by it being "the intended behavior".  After all,
from the user's perspective, this particular gotcha is equivalent to the
problem this autoselect delay feature was meant to address (ie, window
selection occurs as you move across a window to the menu-bar to perform an
action you intended for the original window), but with a nasty twist - the
twist being that you can't see that window selection had occurred until
after you perform the menu action.  Double ouch.
>  > 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.

Sorry, I didn't express it very well.  Not "reschedule the delay", but
"allow the delay to repeat" or "allow the timer to be rescheduled".  What I
meant would be for mouse-autoselect-window-select to not perform selection
if the menu-bar or a popup-menu was active.  Since this function is run from
a timer with a repeat time, and we would not cancel the timer in this case,
this function will just run again.  In principle, would this DTRT?

Looking at CVS just now, it seems there is no way of knowing from Lisp if
the menu-bar or a popup-menu is active.  However, popup_activated_flag
appears to represent this situation.  If so, assuming it is available on all
windowing platforms, it could be exposed to Lisp.


reply via email to

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