> emacs -Q > > ;; Evaluate this code: > > (defun bar () > (interactive) > (message "%s :: %s" last-nonmenu-event > (posn-window (event-start last-nonmenu-event))) > (sit-for 5)) > > (global-set-key > [down-mouse-2] > '(menu-item "foo" > (keymap "foo" > (bar menu-item "bar" bar) > (submenu menu-item "submenu" > (keymap "submenu" (bar menu-item "bar" bar)))))) > > C-x 2 > Put "scratch" in one window, "messages" in the other. > Select "messages" window. > Move mouse over "scratch", but do not select it. > Press mouse-2, and select the "bar" menu-item. > > > When called from the top-level menu, `bar' correctly returns: > > (down-mouse-2 (# 534 (251 . 101) 2649593899 nil > 534 (27 . 6) nil (8 . 11) (9 . 15))) :: # > > > When called from the submenu, `bar' returns a bad result: > > bar :: # > > The window is wrong, etc. Glenn, just for fun please try the attached patch. It seems to solve your problem here but I have no idea whether it has any detrimental side-effects. martin