]> git.eshelyaron.com Git - emacs.git/commit
Optimize coordinate translation during event handling
authorPo Lu <luangruo@yahoo.com>
Tue, 27 Sep 2022 02:50:34 +0000 (10:50 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 27 Sep 2022 02:51:13 +0000 (10:51 +0800)
commit51ec68b3182914c6c95d6ddcd88ae75239ec2904
treeb34fc551d9a9dcab441f60c435e78da7913a3088
parentcd88f6de4be1f8eba1db038b371d769f584be53b
Optimize coordinate translation during event handling

These changes noticeably improve turning the mouse wheel on top of
scroll bars etc over slow network connections.

* src/xterm.c (x_dnd_note_self_position, x_dnd_note_self_wheel)
(x_dnd_note_self_drop): Use x_translate_coordinates.
(x_compute_root_window_offset): New function for calculating and
caching root window offsets of edit window.
(x_translate_coordinates): New function.  Use cached values
whenever possible.
(xi_compute_root_window_offset)
(xi_compute_root_window_offset_pinch): New wrappers for XI2
events.
(x_construct_mouse_click, handle_one_xevent): Use
x_translate_coordinates wherever appropriate.
* src/xterm.h (struct x_output): New fields for keeping track of
the root window offset of the edit window.
src/xterm.c
src/xterm.h