File: prevent-xwayland-crash.patch

package info (click to toggle)
blobandconquer 1.11-dfsg%2B20-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 89,720 kB
  • sloc: cpp: 39,033; ansic: 362; makefile: 143
file content (26 lines) | stat: -rw-r--r-- 1,173 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
Description: Prevent a crash on XWayland
 Prevent the use of XWayland in Wayland environments, as it can lead to a crash when trying to render the game window.
 This setting forces the use of native Wayland if available, and fall back to X11 when not in a Wayland session.
 The crash can still be reproduced by exporting SDL_VIDEODRIVER=x11 prior to running the game on Wayland.
 See https://bugs.debian.org/1037045 for more details.
Author: Antoine Le Gonidec <debian@vv221.fr>
Forwarded: no
Last-Update: 2025-03-04
---
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -98,6 +98,14 @@
 	textdomain("blobAndConquer");
 	bindtextdomain("blobAndConquer", LOCALEDIR);
 
+	/*
+	 * Prevent the use of XWayland in Wayland environments, as it can lead to a crash when trying to render the game window.
+	 * This setting forces the use of native Wayland if available, and fall back to X11 when not in a Wayland session.
+	 * The crash can still be reproduced by exporting SDL_VIDEODRIVER=x11 prior to running the game on Wayland.
+	 * See https://bugs.debian.org/1037045 for more details.
+	 */
+	setenv("SDL_VIDEODRIVER", "wayland,x11", 0);
+
 	atexit(cleanup);
 	
 	game->saveSlot = -1;