From 8c0395bc7c0e9638eb9982c2aec6815c902784ab Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 12 Jul 2023 14:33:09 +0200 Subject: [PATCH] fix: Prevent wayland from spamming the console with useless errors --- main/source/window/window.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/source/window/window.cpp b/main/source/window/window.cpp index 6e62b77cd..f6961210d 100644 --- a/main/source/window/window.cpp +++ b/main/source/window/window.cpp @@ -720,8 +720,15 @@ namespace hex { void Window::initGLFW() { glfwSetErrorCallback([](int error, const char *desc) { + if (error == GLFW_PLATFORM_ERROR) { + // 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; + } + try { - log::error("GLFW Error [{}] : {}", error, desc); + log::error("GLFW Error [0x{:05X}] : {}", error, desc); } catch (const std::system_error &) { // Catch and ignore system error that might be thrown when too many errors are being logged to a file }