diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index ee9f3a17d..f4be6fd75 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -403,8 +403,14 @@ bool GlfwApplication::tryCreate(const Configuration& configuration, const GLConf /* Create window. Hide it by default so we don't have distracting window blinking in case we have to destroy it again right away. If the creation - succeeds, make the context current so we can query GL_VENDOR below. */ - glfwWindowHint(GLFW_VISIBLE, false); + succeeds, make the context current so we can query GL_VENDOR below. + If we are on Wayland, this is causing a segfault; a blinking window is + acceptable in this case. */ + constexpr const char waylandString[] = "wayland"; + if(std::strncmp(std::getenv("XDG_SESSION_TYPE"), waylandString, sizeof(waylandString)) != 0) + glfwWindowHint(GLFW_VISIBLE, false); + else if(_verboseLog) + Warning{} << "Platform::GlfwApplication: Wayland detected, GL context has to be created with the window visible and may cause flicker on startup"; if((_window = glfwCreateWindow(scaledWindowSize.x(), scaledWindowSize.y(), configuration.title().c_str(), monitor, nullptr))) glfwMakeContextCurrent(_window);