From: Po Lu Date: Wed, 23 Feb 2022 10:11:29 +0000 (+0800) Subject: * src/xterm.c (x_term_init): Catch some errors from defective X servers. X-Git-Tag: emacs-29.0.90~2143 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4f53789a0a8f219b9134546aa0b9b705bdf0086d;p=emacs.git * src/xterm.c (x_term_init): Catch some errors from defective X servers. --- 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