From: Po Lu Date: Wed, 12 Jul 2023 10:07:53 +0000 (+0800) Subject: Minor correction to X error handling X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d861de72289464e336c772f1741016a90a2118c5;p=emacs.git Minor correction to X error handling * src/xterm.c (x_error_handler): Clear fail->selection_serial after reporting an error during selection transfer, in case any other outstanding requests within the protected section also report errors. --- diff --git a/src/xterm.c b/src/xterm.c index d65a6829b45..9ecead03b08 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -26439,9 +26439,18 @@ x_error_handler (Display *display, XErrorEvent *event) /* If a selection transfer is the cause of this error, remove the selection transfer now. */ + if (fail->selection_serial) - x_handle_selection_error (fail->selection_serial, - event); + { + x_handle_selection_error (fail->selection_serial, + event); + + /* Clear selection_serial to prevent + x_handle_selection_error from being called again if + any more requests within the protected section cause + errors to be reported. */ + fail->selection_serial = 0; + } return 0; }