| 1 | Descriptionscip-debian debian blobandconquer 1.11-dfsg+20-6 blobandconquer/patches/`prevent-xwayland-crash.patch`#Description.: Prevent a crash on XWayland |
| 2 | Prevent the use of XWayland in Wayland environments, as it can lead to a crash when trying to render the game window. |
| 3 | This setting forces the use of native Wayland if available, and fall back to X11 when not in a Wayland session. |
| 4 | The crash can still be reproduced by exporting SDL_VIDEODRIVER=x11 prior to running the game on Wayland. |
| 5 | See https://bugs.debian.org/1037045 for more details. |
| 6 | Authorscip-debian debian blobandconquer 1.11-dfsg+20-6 blobandconquer/patches/`prevent-xwayland-crash.patch`#Author.: Antoine Le Gonidec <[email protected]scip-debian . . . identity/`[email protected]`.> |
| 7 | Forwardedscip-debian debian blobandconquer 1.11-dfsg+20-6 blobandconquer/patches/`prevent-xwayland-crash.patch`#Forwarded.: no |
| 8 | Last-Updatescip-debian debian blobandconquer 1.11-dfsg+20-6 blobandconquer/patches/`prevent-xwayland-crash.patch`#Last-Update.: 2025-03-04 |
| 9 | --- |
| 10 | --- a/src/main.cppscip-debian debian blobandconquer 1.11-dfsg+20-6 blobandconquer/upstream/`src/main.cpp`: |
| 11 | +++ b/src/main.cppscip-debian debian blobandconquer 1.11-dfsg+20-6 blobandconquer/upstream/`src/main.cpp`: |
| 12 | @@ -98,6 +98,14 @@ |
| 13 | textdomain("blobAndConquer"); |
| 14 | bindtextdomain("blobAndConquer", LOCALEDIR); |
| 15 | |
| 16 | + /* |
| 17 | + * Prevent the use of XWayland in Wayland environments, as it can lead to a crash when trying to render the game window. |
| 18 | + * This setting forces the use of native Wayland if available, and fall back to X11 when not in a Wayland session. |
| 19 | + * The crash can still be reproduced by exporting SDL_VIDEODRIVER=x11 prior to running the game on Wayland. |
| 20 | + * See https://bugs.debian.org/1037045 for more details. |
| 21 | + */ |
| 22 | + setenv("SDL_VIDEODRIVER", "wayland,x11", 0); |
| 23 | + |
| 24 | atexit(cleanup); |
| 25 | |
| 26 | game->saveSlot = -1; |