From: Olly Betts Date: Sat, 18 Jul 2026 23:00:40 +0000 (-0400) Subject: Force X11 if wx GL library is loaded X-Git-Tag: archive/raspbian/3.2.11+dfsg1-1+rpi1~1^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d5de138d6843ca344c83bc25829c55a87b97525a;p=wxwidgets3.2.git Force X11 if wx GL library is loaded Bug: https://trac.wxwidgets.org/ticket/17702 Bug-Debian: https://bugs.debian.org/900678 Forwarded: not-needed Last-Update: 2022-11-28 Gbp-Pq: Name force-x11-for-wxgl.patch --- diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index b3251cd..f93ab98 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -18,6 +18,17 @@ #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)