File: force-x11-for-wxgl.patch

package info (click to toggle)
wxwidgets3.0 3.0.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 120,464 kB
  • sloc: cpp: 896,633; makefile: 52,303; ansic: 21,971; sh: 5,713; python: 2,940; xml: 1,534; perl: 264; javascript: 33
file content (27 lines) | stat: -rw-r--r-- 884 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Force X11 if wx GL library is loaded
Author: Olly Betts <olly@survex.com>
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 <gdk/gdkx.h>
 #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
 
 //-----------------------------------------------------------------------------