GHOST/wayland: use Wayland only when 'BLENDER_WAYLAND' is set

This commit is contained in:
Christian Rauch 2021-07-22 21:37:41 +01:00
parent a2ccd0e495
commit c971c851d3
Notes: blender-bot 2023-12-08 16:39:08 +01:00
Referenced by commit c17a266e29, Revert "GHOST/wayland: use Wayland only when 'BLENDER_WAYLAND' is set"
1 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,12 @@ GHOST_TSuccess GHOST_ISystem::createSystem()
/* Special case, try Wayland, fall back to X11. */
try {
m_system = new GHOST_SystemWayland();
if (!std::getenv("BLENDER_WAYLAND")) {
printf("Connected to a Wayland compositor but Wayland is disabled at "\
"runtime.\nSet environment variable 'BLENDER_WAYLAND' (e.g. "\
"BLENDER_WAYLAND= blender) to use Wayland.\n");
throw std::runtime_error(std::string());
}
}
catch (const std::runtime_error &) {
/* fallback to X11. */