[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xterm-mouse-mode gives incorrect posn-object-x-y with display space
From: |
Stefan Monnier |
Subject: |
Re: xterm-mouse-mode gives incorrect posn-object-x-y with display space |
Date: |
Thu, 24 Nov 2022 13:09:48 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Hi JD,
Could you re-send this via `M-x report-emacs-bug`.
Stefan
JD Smith [2022-11-24 12:22:44] wrote:
> The mouse-down events delivered by xterm-mouse-mode do not appear to handle
> clicks on entities with specified space display widths correctly. Try this
> in a graphical window, and again in the terminal, with xterm-mouse-mode
> enabled:
>
> (defun my/report-mouse (ev)
> (interactive "e")
> (let* ((posn (event-start ev))
> (rel (posn-object-x-y posn)))
> (message "Got Relative Position %S" rel)))
>
> (insert "\n\n ---- "
> (propertize " "
> 'extend nil
> 'display '(space :width (48))
> 'keymap '(keymap (down-mouse-1 . my/report-mouse))
> 'font-lock-face 'underline)
> " ---- ")
>
> Mouse 1 click positions relative to the extended-width space (underlined for
> visibility) are reported correctly in graphical emacs, in screen pixel units.
> With xterm-mouse-mode, however, relative positions are always reported as (0
> . 0) for me, no matter where you click. Is something wrong with my
> assumption that posn-object-x-y should work similarly in graphical as well as
> terminal emacs with xterm-mouse-mode (modulo the larger “pixel” size)?