From fc95e5a9a8d55d586215d472ce6eff7651bc3300 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 4 Jan 2025 22:00:26 +0100 Subject: [PATCH] impr: Unlock frame rate when scrolling or focusing --- main/gui/source/window/window.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 31b757b23..7705b7b8c 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -838,6 +838,16 @@ namespace hex { win->m_unlockFrameRate = true; }); + glfwSetScrollCallback(m_window, [](GLFWwindow *window, double, double) { + auto win = static_cast(glfwGetWindowUserPointer(window)); + win->m_unlockFrameRate = true; + }); + + glfwSetWindowFocusCallback(m_window, [](GLFWwindow *window, int) { + auto win = static_cast(glfwGetWindowUserPointer(window)); + win->m_unlockFrameRate = true; + }); + glfwSetWindowFocusCallback(m_window, [](GLFWwindow *, int focused) { EventWindowFocused::post(focused == GLFW_TRUE); });