fix: Wayland error discarding build errors with older GLFW versions
This commit is contained in:
parent
275774a10a
commit
7a14e3dac4
@ -398,11 +398,16 @@ namespace hex::init {
|
||||
|
||||
void WindowSplash::initGLFW() {
|
||||
glfwSetErrorCallback([](int errorCode, const char *desc) {
|
||||
if (errorCode == GLFW_PLATFORM_ERROR || errorCode == GLFW_FEATURE_UNAVAILABLE) {
|
||||
bool isWaylandError = errorCode == GLFW_PLATFORM_ERROR;
|
||||
#if defined(GLFW_FEATURE_UNAVAILABLE)
|
||||
isWaylandError = isWaylandError || (errorCode == GLFW_FEATURE_UNAVAILABLE);
|
||||
#endif
|
||||
isWaylandError = isWaylandError && std::string_view(desc).contains("Wayland");
|
||||
|
||||
if (isWaylandError) {
|
||||
// Ignore error spam caused by Wayland not supporting moving or resizing
|
||||
// windows or querying their position and size.
|
||||
if (std::string_view(desc).contains("Wayland"))
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
lastGlfwError.errorCode = errorCode;
|
||||
|
@ -698,11 +698,16 @@ namespace hex {
|
||||
void Window::initGLFW() {
|
||||
auto initialWindowProperties = ImHexApi::System::getInitialWindowProperties();
|
||||
glfwSetErrorCallback([](int error, const char *desc) {
|
||||
if (error == GLFW_PLATFORM_ERROR || error == GLFW_FEATURE_UNAVAILABLE) {
|
||||
bool isWaylandError = error == GLFW_PLATFORM_ERROR;
|
||||
#if defined(GLFW_FEATURE_UNAVAILABLE)
|
||||
isWaylandError = isWaylandError || (error == GLFW_FEATURE_UNAVAILABLE);
|
||||
#endif
|
||||
isWaylandError = isWaylandError && std::string_view(desc).contains("Wayland");
|
||||
|
||||
if (isWaylandError) {
|
||||
// Ignore error spam caused by Wayland not supporting moving or resizing
|
||||
// windows or querying their position and size.
|
||||
if (std::string_view(desc).contains("Wayland"))
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user