| 1 | 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 | Author: Antoine Le Gonidec <[email protected]> |
| 7 | Forwarded: no |
| 8 | Last-Update: 2025-03-04 |
| 9 | --- |
| 10 | --- a/src/main.cpp |
| 11 | +++ b/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; |