Browse Source

GlfwApplication: fix for empty env XDG_SESSION_TYPE

pull/403/head
Konstantinos Chatzilygeroudis 7 years ago committed by Vladimír Vondruš
parent
commit
5e5c5f7945
  1. 3
      src/Magnum/Platform/GlfwApplication.cpp

3
src/Magnum/Platform/GlfwApplication.cpp

@ -469,7 +469,8 @@ bool GlfwApplication::tryCreate(const Configuration& configuration, const GLConf
If we are on Wayland, this is causing a segfault; a blinking window is If we are on Wayland, this is causing a segfault; a blinking window is
acceptable in this case. */ acceptable in this case. */
constexpr const char waylandString[] = "wayland"; constexpr const char waylandString[] = "wayland";
if(std::strncmp(std::getenv("XDG_SESSION_TYPE"), waylandString, sizeof(waylandString)) != 0) const char* const xdgSessionType = std::getenv("XDG_SESSION_TYPE");
if(!xdgSessionType || std::strncmp(xdgSessionType, waylandString, sizeof(waylandString)) != 0)
glfwWindowHint(GLFW_VISIBLE, false); glfwWindowHint(GLFW_VISIBLE, false);
else if(_verboseLog) else if(_verboseLog)
Warning{} << "Platform::GlfwApplication: Wayland detected, GL context has to be created with the window visible and may cause flicker on startup"; Warning{} << "Platform::GlfwApplication: Wayland detected, GL context has to be created with the window visible and may cause flicker on startup";

Loading…
Cancel
Save