#include "wx/gtk/private/wrapgdk.h"
#include "wx/gtk/private/backend.h"
+#if GTK_CHECK_VERSION(3,10,0)
+// wxGTK's wxGLCanvas requires X11 currently, so tell GDK that so under
+// Wayland the app is still run using X11. We put this here so it's
+// only run when the wx GL library is loaded (in a monolithic build this
+// will always be active if wx's GL support is enabled).
+struct ForceX11 {
+ ForceX11() { gdk_set_allowed_backends("x11"); }
+};
+static ForceX11 forcex11;
+#endif
+
#ifdef __WXGTK3__
extern "C" {
static gboolean draw(GtkWidget* widget, cairo_t* cr, wxGLCanvas* win)