Pass DefaultScreen(display) to glXQueryExtensions

Pass DefaultScreen(display) as the screen number to
glXQueryExtensionsString(display, screen), this may work more reliably
for some configurations than always assuming screen 0.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2022-08-09 14:45:11 +00:00
parent 395ed0eb2a
commit 643ec0f7b6
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 3 additions and 1 deletions

View File

@ -2170,7 +2170,9 @@ void GLDrawingPanel::DrawingPanelInit()
static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = NULL;
static PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA = NULL;
char* glxQuery = (char*)glXQueryExtensionsString(glXGetCurrentDisplay(), 0);
auto display = glXGetCurrentDisplay();
char* glxQuery = (char*)glXQueryExtensionsString(display, DefaultScreen(display));
if (strstr(glxQuery, "GLX_EXT_swap_control") != NULL)
{