From 4f53789a0a8f219b9134546aa0b9b705bdf0086d Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 23 Feb 2022 18:11:29 +0800 Subject: [PATCH] * src/xterm.c (x_term_init): Catch some errors from defective X servers. --- src/xterm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xterm.c b/src/xterm.c index d78c5d72509..a3c3c6f3f45 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -16414,9 +16414,10 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) request results in an error. If that doesn't work, however, then it's the latter, so decrease the minor until the version that GTK requested is found. */ - x_catch_errors (dpyinfo->display); #endif + x_catch_errors (dpyinfo->display); + rc = XIQueryVersion (dpyinfo->display, &major, &minor); #ifdef HAVE_GTK3 @@ -16460,6 +16461,11 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) } else x_uncatch_errors_after_check (); +#else + if (x_had_errors_p (dpyinfo->display)) + rc = BadRequest; + + x_uncatch_errors_after_check (); #endif if (rc == Success) @@ -16468,6 +16474,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) x_init_master_valuators (dpyinfo); } } + dpyinfo->xi2_version = minor; #endif -- 2.39.5