emacs-devel
[Top][All Lists]
Advanced

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

Re: mouse-face and help echo support for xterm mouse


From: Stefan Monnier
Subject: Re: mouse-face and help echo support for xterm mouse
Date: Thu, 05 Nov 2020 15:18:12 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Using ev-data's x,y would add significant complexity.  ev-data is a posn,
> which is window part relative, not frame relative.

Fair enough.

>>> +(defun xterm-mouse--handle-mouse-motion ()
>>> +  "Handle mouse motion that was just generated for XTerm mouse."
>>> +  (let ((frame (selected-frame)))
>>> +    (handle-lisp-mouse-motion frame
>>> +                              (terminal-parameter frame 'xterm-mouse-x)
>>> +                              (terminal-parameter frame
>>> 'xterm-mouse-y))))
>> This is the only caller to `handle-lisp-mouse-motion` and that function
>> has a "default frame to selected-frame" feature, so you could pass nil
>> instead of `frame`.  Better yet, drop that frame argument altogether.
>> And I think the function's name should make it clear it's for internal
>> use only, or otherwise try to use some prefix that indicates it's
>> related to the display.  Like `display-update-for-mouse-motion`?
> Is there a way I can name it that makes it clear this is an internal
> function and we may change the arguments in the future?

I'd suggest `display--update-for-mouse-action`, then.

> I was hoping that this function would work with background frames
> across different TTYs in case I can figure out how to get
> that working.

Not sure why that would require a frame that's not `selected_frame`.

>> [ I'm reminded here of the tension between using "mouse-motion"
>>   because it's shorter and using "mouse-movement" because that's the
>>   name of the event.  ]
> I squared this circle by using "mouse motion" for the concept and "mouse
> movement" for the event.

Sounds good.

>> Would it make sense to try and add this test to the "generic" part of
>> the code?
> This is not possible without much further work.  These are all tied with the
> C mouse event path: last_mouse_x, last_mouse_y, and frame.mouse_moved are
> all used by the mouse position hook and integrated with keyboard.c's mouse
> event generation.

Fair enough.  Maybe you can add a brief FIXME comment explaining just
that (or pointing to this discussion).


        Stefan




reply via email to

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