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: Marshall, Simon
Subject: RE: mouse-autoselect-window with menu pane
Date: Fri, 15 Sep 2006 15:47:14 +0100

>  > The function I wrote just returned Qnil/Qt based on popup_activated(),
which
>  > is non-zero if the menu-bar or a popup-menu is active.  That includes
dialog
>  > boxes.
> 
> Fine.  However, as I said before it doesn't work this way 
> neither on w32
> nor on mac.  Anyway, please send me just the code of that function and
> tell me how you handle it in mouse-autoselect-window-select.  

See below.  I only tested it with Motif.

> As Richard said we have to avoid that the timer triggers and the window 
> is selected immediately after the menu has become inactive.

Well, he said "it would be good", not "we have to".  Though I agree with
rms, I can live with not rescheduling the timer at the moment of
deactivation.

After all, the user is going to have to move the mouse back into the lower
window regardless of whether you reschedule the timer or not, in which case
autoselection will switch back to the lower window again if necessary.
Also, we don't reschedule the timer when we're interacting with the
scroll-bar of a non-selected window.  If we do this for menu-bar/popup-menu,
shouldn't we do the same for scroll-bar?

So, I don't see it being a must-have for this specific fix, particularly
since I think the implementation will be non-trivial (I assume you would
have to maintain some sort of state).  IMHO, if you do it, do it separately
from this fix and try to make it consistent with scoll-bar autoselection
behaviour.

Index: src/xmenu.c
===================================================================
RCS file: /sources/emacs/emacs/src/xmenu.c,v
retrieving revision 1.308
diff -c -r1.308 xmenu.c
*** src/xmenu.c 9 Sep 2006 17:51:17 -0000       1.308
--- src/xmenu.c 15 Sep 2006 14:06:10 -0000
***************
*** 1038,1043 ****
--- 1038,1050 ----
    return selection;
  }
  
+ DEFUN ("x-popup-activatedp", Fx_popup_activatedp, Sx_popup_activatedp, 0,
0, 0,
+        doc: /* Return non-nil if the menu-bar or a popup-menu is active.
*/)
+      ()
+ {
+   return popup_activated() ? Qt : Qnil;
+ }
+ 
  #ifdef HAVE_MENUS
  
  DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0,
***************
*** 3764,3769 ****
--- 3771,3777 ----
  #endif
  
    defsubr (&Sx_popup_menu);
+   defsubr (&Sx_popup_activatedp);
  
  #if defined (USE_GTK) || defined (USE_X_TOOLKIT)
    defsubr (&Smenu_bar_open);

Index: lisp/window.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/window.el,v
retrieving revision 1.117
diff -c -r1.117 window.el
*** lisp/window.el      8 Sep 2006 14:15:02 -0000       1.117
--- lisp/window.el      15 Sep 2006 14:06:10 -0000
***************
*** 835,840 ****
--- 835,843 ----
             (window (window-at (cadr mouse-position) (cddr mouse-position)
                                (car mouse-position))))
        (cond
+        ((x-popup-activatedp)
+         ;; If the menu-bar or a popup-menu is active, do nothing.
+         nil)
         ((and window (not (eq window (selected-window)))
               (or (not (numberp mouse-autoselect-window))
                   (and (> mouse-autoselect-window 0)





reply via email to

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