diff --git a/src/glx/clientinfo.c b/src/glx/clientinfo.c index a7853ff8aa3..31c62ad989f 100644 --- a/src/glx/clientinfo.c +++ b/src/glx/clientinfo.c @@ -28,8 +28,8 @@ #include #include -_X_HIDDEN void -__glX_send_client_info(struct glx_display *glx_dpy) +void +glxSendClientInfo(struct glx_display *glx_dpy, int screen) { const unsigned ext_length = strlen("GLX_ARB_create_context"); const unsigned prof_length = strlen("_profile"); @@ -152,11 +152,7 @@ __glX_send_client_info(struct glx_display *glx_dpy) } } - gl_extension_string = __glXGetClientGLExtensionString(); - if (gl_extension_string == NULL) { - return; - } - + gl_extension_string = __glXGetClientGLExtensionString(screen); gl_extension_length = strlen(gl_extension_string) + 1; c = XGetXCBConnection(glx_dpy->dpy); diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 8eda47988b4..ad0f37b258a 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -706,8 +706,7 @@ extern void __glEmptyImage(struct glx_context *, GLint, GLint, GLint, GLint, GLe extern void __glXInitVertexArrayState(struct glx_context *); extern void __glXFreeVertexArrayState(struct glx_context *); -_X_HIDDEN void -__glX_send_client_info(struct glx_display *glx_dpy); +extern void glxSendClientInfo(struct glx_display *glx_dpy, int screen); /************************************************************************/ diff --git a/src/glx/glxext.c b/src/glx/glxext.c index cc59004ccff..b1b98a9fadd 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -929,7 +929,7 @@ __glXInitialize(Display * dpy) return NULL; } - __glX_send_client_info(dpyPriv); + glxSendClientInfo(dpyPriv, -1); /* Grab the lock again and add the dispay private, unless somebody * beat us to initializing on this display in the meantime. */ diff --git a/src/glx/glxextensions.c b/src/glx/glxextensions.c index 88cd05b37da..6cf1c24b2a7 100644 --- a/src/glx/glxextensions.c +++ b/src/glx/glxextensions.c @@ -763,7 +763,10 @@ __glXCalculateUsableGLExtensions(struct glx_context * gc, * supported by the client to the server. */ char * -__glXGetClientGLExtensionString(void) +__glXGetClientGLExtensionString(int screen) { + if (screen < 0) + return strdup(""); + return __glXGetStringFromTable(known_gl_extensions, NULL); } diff --git a/src/glx/glxextensions.h b/src/glx/glxextensions.h index 0fdabb8d089..b81d66b7d8d 100644 --- a/src/glx/glxextensions.h +++ b/src/glx/glxextensions.h @@ -270,7 +270,7 @@ extern void __IndirectGlParseExtensionOverride(struct glx_screen *psc, const char *override); extern void __glXCalculateUsableGLExtensions(struct glx_context *gc, const char *server_string); -extern char *__glXGetClientGLExtensionString(void); +extern char *__glXGetClientGLExtensionString(int screen); extern GLboolean __glExtensionBitIsEnabled(struct glx_context *gc, unsigned bit); diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c index ffdfec48d8b..80e95f6754e 100644 --- a/src/glx/indirect_glx.c +++ b/src/glx/indirect_glx.c @@ -383,6 +383,7 @@ indirect_create_screen(int screen, struct glx_display * priv) return NULL; glx_screen_init(psc, screen, priv); + glxSendClientInfo(priv, screen); psc->vtable = &indirect_screen_vtable; return psc; diff --git a/src/glx/tests/clientinfo_unittest.cpp b/src/glx/tests/clientinfo_unittest.cpp index 0202768cf11..f7a147e3f7a 100644 --- a/src/glx/tests/clientinfo_unittest.cpp +++ b/src/glx/tests/clientinfo_unittest.cpp @@ -210,7 +210,7 @@ xcb_glx_set_client_info_2arb(xcb_connection_t *c, } extern "C" char * -__glXGetClientGLExtensionString() +__glXGetClientGLExtensionString(int screen) { char *str = (char *) malloc(sizeof(ext)); @@ -279,7 +279,7 @@ glX_send_client_info_test::common_protocol_expected_false_test(unsigned major, bool *value) { create_single_screen_display(major, minor, glx_ext); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); EXPECT_FALSE(*value); } @@ -290,7 +290,7 @@ glX_send_client_info_test::common_protocol_expected_true_test(unsigned major, bool *value) { create_single_screen_display(major, minor, glx_ext); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); EXPECT_TRUE(*value); } @@ -494,14 +494,14 @@ TEST_F(glX_send_client_info_test, does_send_SetClientInfo2ARB_for_1_4_with_both_ TEST_F(glX_send_client_info_test, uses_correct_connection) { create_single_screen_display(1, 1, ""); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); EXPECT_EQ((xcb_connection_t *) 0xdeadbeef, connection_used); } TEST_F(glX_send_client_info_test, sends_correct_gl_extension_string) { create_single_screen_display(1, 1, ""); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); ASSERT_EQ((int) sizeof(ext), gl_ext_length); ASSERT_NE((char *) 0, gl_ext_string); @@ -511,7 +511,7 @@ TEST_F(glX_send_client_info_test, sends_correct_gl_extension_string) TEST_F(glX_send_client_info_test, gl_versions_are_sane) { create_single_screen_display(1, 4, "GLX_ARB_create_context"); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); ASSERT_NE(0, num_gl_versions); @@ -552,7 +552,7 @@ TEST_F(glX_send_client_info_test, gl_versions_are_sane) TEST_F(glX_send_client_info_test, gl_versions_and_profiles_are_sane) { create_single_screen_display(1, 4, "GLX_ARB_create_context_profile"); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); ASSERT_NE(0, num_gl_versions); @@ -621,7 +621,7 @@ TEST_F(glX_send_client_info_test, gl_versions_and_profiles_are_sane) TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_1) { create_single_screen_display(1, 1, ""); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); EXPECT_EQ(1, glx_major); EXPECT_EQ(4, glx_minor); @@ -630,7 +630,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_1) TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4) { create_single_screen_display(1, 4, ""); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); EXPECT_EQ(1, glx_major); EXPECT_EQ(4, glx_minor); @@ -639,7 +639,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4) TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_context) { create_single_screen_display(1, 4, "GLX_ARB_create_context"); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); EXPECT_EQ(1, glx_major); EXPECT_EQ(4, glx_minor); @@ -648,7 +648,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_con TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_context_profile) { create_single_screen_display(1, 4, "GLX_ARB_create_context_profile"); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); EXPECT_EQ(1, glx_major); EXPECT_EQ(4, glx_minor); @@ -657,7 +657,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_con TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_5) { create_single_screen_display(1, 5, ""); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); EXPECT_EQ(1, glx_major); EXPECT_EQ(4, glx_minor); @@ -666,7 +666,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_5) TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context) { create_single_screen_display(1, 4, "GLX_ARB_create_context"); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); ASSERT_NE(0, glx_ext_length); ASSERT_NE((char *) 0, glx_ext_string); @@ -692,7 +692,7 @@ TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context) TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context_profile) { create_single_screen_display(1, 4, "GLX_ARB_create_context_profile"); - __glX_send_client_info(this->glx_dpy); + glxSendClientInfo(this->glx_dpy, -1); ASSERT_NE(0, glx_ext_length); ASSERT_NE((char *) 0, glx_ext_string);