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.
This commit is contained in:
Po Lu 2023-07-12 18:07:53 +08:00
parent 82edb3fdb0
commit d861de7228

View file

@ -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;
}