emacs-devel
[Top][All Lists]
Advanced

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

Re: when to bind *down-mouse* vs *mouse*?


From: Jan D.
Subject: Re: when to bind *down-mouse* vs *mouse*?
Date: Tue, 07 Dec 2004 14:20:19 +0100
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

Luc Teirlinck wrote:

The patch below fixes this.  Note that, in addition to fixing the bug,
it seems to point out a problem with the `x-popup-menu' docstring
which says:

 x-popup-menu is a built-in function in `C source code'.
 (x-popup-menu position menu)

 Pop up a deck-of-cards menu and return user's selection.
 position is a position specification.  This is either a mouse button event
 or a list ((XOFFSET YOFFSET) WINDOW)
 where XOFFSET and YOFFSET are positions in pixels from the top left
 corner of WINDOW's frame.  (WINDOW may be a frame object instead of a window.)
 This controls the position of the center of the first line
 in the first pane of the menu, not the top left of the menu as a whole.

But applying the patch below, which uses (0 0) for (XOFFSET YOFFSET)
seems to show that it controls the position of the top left of the
menu as a whole, no matter how clearly this is denied above.

The documentation is correct for the old X menu (i.e. no Lesstif/Motif/Lucid/GTK) code. But for other menus it is wrong. I've changed the documentation and also changed the positioning for the old X menu to comply.

I've only changed for X. As for W32, it pops up a bit to the left (half the menu width?) and on OSX it kind of pops up at the given coordinates, but not quite. I suggest that someone who knows about those platforms in detail change the documentation to whatever is appropriate. The current documentation is not right for those platforms.

I can install the patch if desired.

Looks fine to me.

   Jan D.

===File ~/mouse.el-diff=====================================
*** mouse.el    12 Nov 2004 19:47:19 -0600      1.257
--- mouse.el    04 Dec 2004 17:35:29 -0600      
***************
*** 2201,2207 ****
    (progn (unless (display-multi-font-p)
            (error "Cannot change fonts on this display"))
          (x-popup-menu
!          last-nonmenu-event
           ;; Append list of fontsets currently defined.
           (append x-fixed-font-alist (list (generate-fontset-menu))))))
   (if fonts
--- 2201,2209 ----
    (progn (unless (display-multi-font-p)
            (error "Cannot change fonts on this display"))
          (x-popup-menu
!          (if (listp last-nonmenu-event)
!              last-nonmenu-event
!            (list '(0 0) (selected-window)))
           ;; Append list of fontsets currently defined.
           (append x-fixed-font-alist (list (generate-fontset-menu))))))
   (if fonts





reply via email to

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