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.