From eec6a5da0a719402cceda6612ca72347ff46f6f3 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 10 May 2025 10:43:07 +0200 Subject: [PATCH] impr: Unlock frame rate in more cases --- main/gui/source/window/win_window.cpp | 3 +++ main/gui/source/window/window.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/main/gui/source/window/win_window.cpp b/main/gui/source/window/win_window.cpp index a4c1bbec1..74e0959bb 100644 --- a/main/gui/source/window/win_window.cpp +++ b/main/gui/source/window/win_window.cpp @@ -518,6 +518,9 @@ namespace hex { EventFileDropped::post(reinterpret_cast(paths[i])); } }); + EventFileDropped::subscribe([this] { + this->unlockFrameRate(); + }); } bool borderlessWindowMode = ImHexApi::System::isBorderlessWindowModeEnabled(); diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index e0469cb9c..0e0c4c768 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -329,6 +329,11 @@ namespace hex { // Unlock frame rate if there's more than one viewport since these don't call the glfw callbacks registered here if (ImGui::GetPlatformIO().Viewports.size() > 1) this->unlockFrameRate(); + + // Unlock frame rate if there's any task running that shows a loading animation + if (TaskManager::getRunningTaskCount() > 0 || TaskManager::getRunningBlockingTaskCount() > 0) { + this->unlockFrameRate(); + } } // Hide the window as soon as the render loop exits to make the window