diff options
| author | Ken Raeburn | 2015-10-07 06:04:01 -0400 |
|---|---|---|
| committer | Ken Raeburn | 2015-10-11 01:15:08 -0400 |
| commit | 5504ede9518053e619b2cc4bb01ce6eff254d3c8 (patch) | |
| tree | 86e3fb272f4f27d8847291256c71bd5e30e06bfc /src/xselect.c | |
| parent | 54e3734a322aca9d396e4c7b0e73f08ac6c12501 (diff) | |
| download | emacs-5504ede9518053e619b2cc4bb01ce6eff254d3c8.tar.gz emacs-5504ede9518053e619b2cc4bb01ce6eff254d3c8.zip | |
Introduce x_uncatch_errors_after_check to reduce XSync calls.
Both x_had_errors_p and x_check_errors call XSync, so if they're
immediately followed by x_uncatch_errors, its XSync call will be
redundant, resulting in a wasted round trip to the X server.
* src/xterm.c (x_uncatch_errors_after_check): New routine; a copy of
x_uncatch_errors without the XSync call.
(XTmouse_position, x_wm_supports):
* src/xfns.c (x_set_mouse_color):
* src/xmenu.c (Fx_menu_bar_open_internal):
* src/xselect.c (x_own_selection, x_get_foreign_selection):
(Fx_get_atom_name): Call it instead of x_uncatch_errors.
* src/xterm.h (x_uncatch_errors_after_check): Declare.
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xselect.c b/src/xselect.c index 9aaa10c6efa..9a7e6974cd9 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -316,7 +316,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value, | |||
| 316 | x_catch_errors (display); | 316 | x_catch_errors (display); |
| 317 | XSetSelectionOwner (display, selection_atom, selecting_window, timestamp); | 317 | XSetSelectionOwner (display, selection_atom, selecting_window, timestamp); |
| 318 | x_check_errors (display, "Can't set selection: %s"); | 318 | x_check_errors (display, "Can't set selection: %s"); |
| 319 | x_uncatch_errors (); | 319 | x_uncatch_errors_after_check (); |
| 320 | unblock_input (); | 320 | unblock_input (); |
| 321 | 321 | ||
| 322 | /* Now update the local cache */ | 322 | /* Now update the local cache */ |
| @@ -1179,7 +1179,7 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type, | |||
| 1179 | XConvertSelection (display, selection_atom, type_atom, target_property, | 1179 | XConvertSelection (display, selection_atom, type_atom, target_property, |
| 1180 | requestor_window, requestor_time); | 1180 | requestor_window, requestor_time); |
| 1181 | x_check_errors (display, "Can't convert selection: %s"); | 1181 | x_check_errors (display, "Can't convert selection: %s"); |
| 1182 | x_uncatch_errors (); | 1182 | x_uncatch_errors_after_check (); |
| 1183 | 1183 | ||
| 1184 | /* Prepare to block until the reply has been read. */ | 1184 | /* Prepare to block until the reply has been read. */ |
| 1185 | reading_selection_window = requestor_window; | 1185 | reading_selection_window = requestor_window; |
| @@ -2364,7 +2364,7 @@ If the value is 0 or the atom is not known, return the empty string. */) | |||
| 2364 | x_catch_errors (dpy); | 2364 | x_catch_errors (dpy); |
| 2365 | name = atom ? XGetAtomName (dpy, atom) : empty; | 2365 | name = atom ? XGetAtomName (dpy, atom) : empty; |
| 2366 | had_errors_p = x_had_errors_p (dpy); | 2366 | had_errors_p = x_had_errors_p (dpy); |
| 2367 | x_uncatch_errors (); | 2367 | x_uncatch_errors_after_check (); |
| 2368 | 2368 | ||
| 2369 | if (!had_errors_p) | 2369 | if (!had_errors_p) |
| 2370 | ret = build_string (name); | 2370 | ret = build_string (name); |