Make another adjustment to glXQueryExtensions

Use GDK/GTK to get the X display instead of glXGetCurrentDisplay().

For #985.

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

View File

@ -3,12 +3,14 @@
#include <cstring> #include <cstring>
#include <vector> #include <vector>
#if defined(__WXGTK__) && defined(HAVE_XSS) #ifdef __WXGTK__
#include <X11/Xlib.h> #include <X11/Xlib.h>
#define Status int #define Status int
#include <X11/extensions/scrnsaver.h>
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#ifdef HAVE_XSS
#include <X11/extensions/scrnsaver.h>
#endif
#endif #endif
#include <wx/dcbuffer.h> #include <wx/dcbuffer.h>
@ -2170,7 +2172,7 @@ void GLDrawingPanel::DrawingPanelInit()
static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = NULL; static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = NULL;
static PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA = NULL; static PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA = NULL;
auto display = glXGetCurrentDisplay(); auto display = GDK_WINDOW_XDISPLAY(gtk_widget_get_window(wxGetApp().frame->GetHandle()));
char* glxQuery = (char*)glXQueryExtensionsString(display, DefaultScreen(display)); char* glxQuery = (char*)glXQueryExtensionsString(display, DefaultScreen(display));