summaryrefslogtreecommitdiff
path: root/src/xselect.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@raeburn.org>2015-10-07 06:04:01 -0400
committerKen Raeburn <raeburn@raeburn.org>2015-10-11 01:15:08 -0400
commit5504ede9518053e619b2cc4bb01ce6eff254d3c8 (patch)
tree86e3fb272f4f27d8847291256c71bd5e30e06bfc /src/xselect.c
parent54e3734a322aca9d396e4c7b0e73f08ac6c12501 (diff)
downloademacs-5504ede9518053e619b2cc4bb01ce6eff254d3c8.tar.gz
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.c6
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,
x_catch_errors (display);
XSetSelectionOwner (display, selection_atom, selecting_window, timestamp);
x_check_errors (display, "Can't set selection: %s");
- x_uncatch_errors ();
+ x_uncatch_errors_after_check ();
unblock_input ();
/* Now update the local cache */
@@ -1179,7 +1179,7 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type,
XConvertSelection (display, selection_atom, type_atom, target_property,
requestor_window, requestor_time);
x_check_errors (display, "Can't convert selection: %s");
- x_uncatch_errors ();
+ x_uncatch_errors_after_check ();
/* Prepare to block until the reply has been read. */
reading_selection_window = requestor_window;
@@ -2364,7 +2364,7 @@ If the value is 0 or the atom is not known, return the empty string. */)
x_catch_errors (dpy);
name = atom ? XGetAtomName (dpy, atom) : empty;
had_errors_p = x_had_errors_p (dpy);
- x_uncatch_errors ();
+ x_uncatch_errors_after_check ();
if (!had_errors_p)
ret = build_string (name);