From f3a9f9ec4544225d6f340fa5f8a0dab9bf39157c Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 30 Jul 2024 15:32:38 +0200 Subject: [PATCH] pointer: use preMonitorCommit for resetting render state in DS preRender is not called --- src/helpers/Monitor.cpp | 2 ++ src/managers/PointerManager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 635427d1..9d282090 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -863,6 +863,8 @@ bool CMonitorState::commit() { if (!updateSwapchain()) return false; + EMIT_HOOK_EVENT("preMonitorCommit", m_pOwner); + ensureBufferPresent(); bool ret = m_pOwner->output->commit(); diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index a405e2eb..8314e79a 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -25,7 +25,7 @@ CPointerManager::CPointerManager() { nullptr); }); - hooks.monitorPreRender = g_pHookSystem->hookDynamic("preRender", [this](void* self, SCallbackInfo& info, std::any data) { + hooks.monitorPreRender = g_pHookSystem->hookDynamic("preMonitorCommit", [this](void* self, SCallbackInfo& info, std::any data) { auto state = stateFor(std::any_cast(data)->self.lock()); if (!state) return;