Return connection failure if display string specifies non-existent screen
[free-sw/xcb/libxcb] / src / xcb_conn.c
index 7202cc5..7979491 100644 (file)
@@ -66,6 +66,7 @@ typedef struct {
 static const int xcb_con_error = XCB_CONN_ERROR;
 static const int xcb_con_closed_mem_er = XCB_CONN_CLOSED_MEM_INSUFFICIENT;
 static const int xcb_con_closed_parse_er = XCB_CONN_CLOSED_PARSE_ERR;
+static const int xcb_con_closed_screen_er = XCB_CONN_CLOSED_INVALID_SCREEN;
 
 static int set_fd_flags(const int fd)
 {
@@ -349,6 +350,10 @@ xcb_connection_t *_xcb_conn_ret_error(int err)
         {
             return (xcb_connection_t *) &xcb_con_closed_parse_er;
         }
+        case XCB_CONN_CLOSED_INVALID_SCREEN:
+        {
+            return (xcb_connection_t *) &xcb_con_closed_screen_er;
+        }
         case XCB_CONN_ERROR:
         default:
         {