From 90957dfb7a21528b19f587b1aa64752f5f2f194e Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 31 May 2022 20:56:43 +0800 Subject: [PATCH] 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. --- src/xterm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index fb7d18a53fb..7235a1e9599 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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]) -- 2.39.2