]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/xterm.c (x_term_init): Catch some errors from defective X servers.
authorPo Lu <luangruo@yahoo.com>
Wed, 23 Feb 2022 10:11:29 +0000 (18:11 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 23 Feb 2022 10:11:29 +0000 (18:11 +0800)
src/xterm.c

index d78c5d72509a0d6fa762bdfe7ff75955ce9e1200..a3c3c6f3f45bed20b9543bd3a0bbbcbca512c274 100644 (file)
@@ -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