HookSystem: improve callback safety
This commit is contained in:
parent
1055e6bee6
commit
4ad739ec63
18 changed files with 89 additions and 105 deletions
|
|
@ -60,7 +60,7 @@ CHyprRenderer::CHyprRenderer() {
|
|||
|
||||
// cursor hiding stuff
|
||||
|
||||
g_pHookSystem->hookDynamic("keyPress", [&](void* self, SCallbackInfo& info, std::any param) {
|
||||
static auto P = g_pHookSystem->hookDynamic("keyPress", [&](void* self, SCallbackInfo& info, std::any param) {
|
||||
if (m_sCursorHiddenConditions.hiddenOnKeyboard)
|
||||
return;
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ CHyprRenderer::CHyprRenderer() {
|
|||
ensureCursorRenderingMode();
|
||||
});
|
||||
|
||||
g_pHookSystem->hookDynamic("mouseMove", [&](void* self, SCallbackInfo& info, std::any param) {
|
||||
static auto P2 = g_pHookSystem->hookDynamic("mouseMove", [&](void* self, SCallbackInfo& info, std::any param) {
|
||||
if (!m_sCursorHiddenConditions.hiddenOnKeyboard && m_sCursorHiddenConditions.hiddenOnTouch == g_pInputManager->m_bLastInputTouch &&
|
||||
!m_sCursorHiddenConditions.hiddenOnTimeout)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue