1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Prevent wayland from spamming the console with useless errors

This commit is contained in:
WerWolv 2023-07-12 14:33:09 +02:00
parent cdc4f2db89
commit 8c0395bc7c

View File

@ -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
}