From 643ec0f7b66c16bdc82c0cb2e2b83944551fa709 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Tue, 9 Aug 2022 14:45:11 +0000 Subject: [PATCH] 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 --- src/wx/panel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index 6a1c0512..76594e86 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -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) {