On 2020-11-01 5:39 am, Stefan Monnier wrote:
Hi Jared,
I really like this new feature but have just one comment/question?
+ previous_help_echo_string = help_echo_string;
+ help_echo_string = Qnil;
+
+ note_mouse_highlight(XFRAME(frame), XFIXNUM (mouse_x), XFIXNUM
(mouse_y));
+
+ if (!NILP (help_echo_string)
+ || !NILP (previous_help_echo_string))
+ {
+ gen_help_event (help_echo_string, frame, help_echo_window,
+ help_echo_object, help_echo_pos);
+ }
I see this exact same code in other C files.
Could we move it to a file where we can share it instead of having
N copies?
I completely agree, not just for this code but also for mouse handling
in general. I think there should be a shared mouse interface with
individual C functions for each type of mouse event: mouse move, mouse
click, etc. Translating OS-specific events to this shared
functionality would continue to be OS-specific, but the actual
handling of these events, such as this logic, would be fully shared.
For example, this would unify the different codepaths between TTY
menus for GPM, xterm-mouse, and NT Emacs.
I would be happy to help with this next. However I need some help. I
can only locally build and test for Linux terminal with xterm-mouse or
GPM handling the mouse. Is there someone who can help for other
platforms? And should the GUI platforms be included as well? (I
suspect yes is the right answer.)