Update wxApp.IsDisplayAvailable to work on Wayland

This commit is contained in:
Scott Talbert
2024-11-07 20:37:45 -05:00
parent 41823e3458
commit 57fd2156f5

View File

@@ -1,6 +1,5 @@
#ifdef __WXGTK__ #ifdef __WXGTK__
#include <gdk/gdkx.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#endif #endif
@@ -299,11 +298,11 @@ int wxPyApp::MainLoop()
bool wxPyApp::IsDisplayAvailable() bool wxPyApp::IsDisplayAvailable()
{ {
#ifdef __WXGTK__ #ifdef __WXGTK__
Display* display; GdkDisplay* display;
display = XOpenDisplay(NULL); display = gdk_display_open(NULL);
if (display == NULL) if (display == NULL)
return false; return false;
XCloseDisplay(display); gdk_display_close(display);
return true; return true;
#endif #endif