From 4ce19f9b88c1a29fd230ab7e043fe35a5540ae48 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Mon, 21 Oct 2019 22:44:56 -0400 Subject: [PATCH] Incorporate patch from Debian to force X11 when using wxGLCanvas --- force-x11-for-wxgl.patch | 27 +++++++++++++++++++++++++++ wxGTK3.spec | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 force-x11-for-wxgl.patch diff --git a/force-x11-for-wxgl.patch b/force-x11-for-wxgl.patch new file mode 100644 index 0000000..964c077 --- /dev/null +++ b/force-x11-for-wxgl.patch @@ -0,0 +1,27 @@ +Description: Force X11 if wx GL library is loaded +Author: Olly Betts +Bug: https://trac.wxwidgets.org/ticket/17702 +Bug-Debian: https://bugs.debian.org/900678 +Forwarded: no +Last-Update: 2019-08-13 + +--- a/src/gtk/glcanvas.cpp ++++ b/src/gtk/glcanvas.cpp +@@ -19,6 +19,17 @@ + #include + #include "wx/gtk/private/gtk2-compat.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 ++ + #if WXWIN_COMPATIBILITY_2_8 + + //----------------------------------------------------------------------------- diff --git a/wxGTK3.spec b/wxGTK3.spec index 03ecf51..f068170 100644 --- a/wxGTK3.spec +++ b/wxGTK3.spec @@ -18,7 +18,7 @@ Name: %{wxgtkname} Version: 3.0.4 -Release: 11%{?snapshottag}%{?dist} +Release: 12%{?snapshottag}%{?dist} Summary: GTK port of the wxWidgets GUI library License: wxWidgets URL: https://www.wxwidgets.org/ @@ -39,6 +39,7 @@ Patch0: %{name}-3.0.3-abicheck.patch Patch1: fix-filename-test.patch Patch2: fix-vararg-test.patch Patch3: fix-glcanvas-crash-wayland.patch +Patch4: force-x11-for-wxgl.patch BuildRequires: gcc-c++ BuildRequires: gtk2-devel @@ -441,6 +442,9 @@ fi %doc html %changelog +* Tue Oct 22 2019 Scott Talbert - 3.0.4-12 +- Incorporate patch from Debian to force X11 when using wxGLCanvas + * Thu Sep 19 2019 Scott Talbert - 3.0.4-11 - Force timezone to UTC when running tests (#1753405)