summaryrefslogtreecommitdiff
path: root/modules/home/imhex-refresh-callback.patch
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home/imhex-refresh-callback.patch')
-rw-r--r--modules/home/imhex-refresh-callback.patch45
1 files changed, 36 insertions, 9 deletions
diff --git a/modules/home/imhex-refresh-callback.patch b/modules/home/imhex-refresh-callback.patch
index eef0251..6f6c147 100644
--- a/modules/home/imhex-refresh-callback.patch
+++ b/modules/home/imhex-refresh-callback.patch
@@ -1,12 +1,39 @@
+diff --git a/main/gui/include/window.hpp b/main/gui/include/window.hpp
+index 48a5b82..554f9c2 100644
+--- a/main/gui/include/window.hpp
++++ b/main/gui/include/window.hpp
+@@ -83,6 +83,8 @@ namespace hex {
+ std::atomic<bool> m_wakeupFlag;
+ std::condition_variable m_wakeupCondVar;
+
++ std::atomic<bool> m_forceRedraw = false;
++
+
+ gl::Shader m_postProcessingShader;
+ };
+diff --git a/main/gui/source/window/linux_window.cpp b/main/gui/source/window/linux_window.cpp
+index 53ad078..2d9f8b1 100644
+--- a/main/gui/source/window/linux_window.cpp
++++ b/main/gui/source/window/linux_window.cpp
+@@ -179,6 +179,7 @@ namespace hex {
+
+ glfwSetWindowRefreshCallback(m_window, [](GLFWwindow *window) {
+ auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
++ win->m_forceRedraw = true;
+ win->fullFrame();
+ });
+
diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp
-index e0469cb..114a0e9 100644
+index e0469cb..c53ea75 100644
--- a/main/gui/source/window/window.cpp
+++ b/main/gui/source/window/window.cpp
-@@ -1099,6 +1099,7 @@ namespace hex {
- glfwSetCursorPosCallback(m_window, unlockFrameRate);
- glfwSetMouseButtonCallback(m_window, unlockFrameRate);
- glfwSetScrollCallback(m_window, unlockFrameRate);
-+ glfwSetWindowRefreshCallback(m_window, unlockFrameRate);
-
- glfwSetWindowFocusCallback(m_window, [](GLFWwindow *window, int focused) {
- unlockFrameRate(window);
+@@ -825,6 +825,9 @@ namespace hex {
+ ImGui::RenderPlatformWindowsDefault();
+ glfwMakeContextCurrent(backupContext);
+
++ if (m_forceRedraw.exchange(false))
++ shouldRender = true;
++
+ if (shouldRender) {
+ #if !defined(OS_WEB)
+ if (m_postProcessingShader.isValid())