]> git.eshelyaron.com Git - emacs.git/commit
Fix pieces of code being too expensive over slow network connections
authorPo Lu <luangruo@yahoo.com>
Mon, 17 Oct 2022 12:56:20 +0000 (20:56 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 17 Oct 2022 13:00:09 +0000 (21:00 +0800)
commitabf683bb0324b9c5d01adb90aedb6aa6fa7175e9
tree1f28271f1c12d4e7bbba87e39433f802d2d0d55c
parentb9aff5fdb89092b68ebd7782c8dc85e6daca14b2
Fix pieces of code being too expensive over slow network connections

* lisp/menu-bar.el (menu-bar-edit-menu): Test buffer-read-only
before gui-backend-selection-exists-p.  This places the less
expensive condition before the more expensive one.
* src/xfns.c (compute_tip_xy): Use cached monitor attributes
whenever available.
(Fx_show_tip): Remove code that really did nothing.
(Fx_backspace_delete_keys_p): Do not download the entire keymap
from the server upon creating a frame.
* src/xmenu.c (create_and_show_popup_menu): Use
x_translate_coordinates_to_root.
(x_menu_show): Use x_translate_coordinates_to_root.
* src/xselect.c (Fx_selection_exists_p): If a temporary
selection owner can be found, use it.
* src/xterm.c (x_translate_coordinates_to_root)
(x_handle_selection_monitor_event, x_find_selection_owner): New
functions.  These functions try to avoid downloading data from
the X server in places that are called very often (i.e. during
tool bar updates.)
(handle_one_xevent): Handle selection notify events.  Also catch
some mistakes found.  Fetch all kinds of key names as well.
(x_create_special_window): New function.
(x_term_init, x_delete_display): Ask for all key names.  Also,
passively monitor selections that are given to
`x-selection-exists-p' during redisplay, so we do not have to
ask the server about them upon each redisplay.
(syms_of_xterm): New variable `x-fast-selection-list'.
* src/xterm.h (struct x_monitored_selection): New structure.
(X_INVALID_WINDOW): New define.
(struct x_display_info): New fields for selection monitoring.
Also, record the fixes extension base.
lisp/menu-bar.el
src/xfns.c
src/xmenu.c
src/xselect.c
src/xterm.c
src/xterm.h