Slightly optimize x_check_errors as well

* src/xterm.c (x_check_errors): Don't sync if no requests were
made since the error trap was installed.
This commit is contained in:
Po Lu 2022-05-31 20:56:43 +08:00
parent dea1a502ef
commit 90957dfb7a

View file

@ -21414,8 +21414,10 @@ x_check_errors (Display *dpy, const char *format)
/* There is no point in making this extra sync if all requests
are known to have been fully processed. */
if (LastKnownRequestProcessed (dpy)
!= NextRequest (dpy) - 1)
if ((LastKnownRequestProcessed (dpy)
!= NextRequest (dpy) - 1)
&& (NextRequest (dpy)
> x_error_message->first_request))
XSync (dpy, False);
if (x_error_message->string[0])