From 9b1417f32da0e26e7167d45cb7b59d7285bcc763 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 12 Mar 2024 09:06:58 +0100 Subject: [PATCH] fix: ImHex using a ton of CPU power on Linux --- main/gui/source/window/window.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index af2eae62d..013fd8904 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -213,6 +213,7 @@ namespace hex { constexpr static auto LongSleepFPS = 5.0; const double timeout = std::max(0.0, (1.0 / LongSleepFPS) - (glfwGetTime() - m_lastStartFrameTime)); + glfwPollEvents(); glfwWaitEventsTimeout(timeout); } else { glfwPollEvents(); @@ -649,8 +650,6 @@ namespace hex { m_unlockFrameRate = true; } - glfwPollEvents(); - // Process layout load requests // NOTE: This needs to be done before a new frame is started, otherwise ImGui won't handle docking correctly LayoutManager::process();