aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/hyprerror
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-04-20 20:16:42 +0100
committerVaxry <[email protected]>2024-04-20 20:16:42 +0100
commit4ad739ec63c9a11f0537a884ae2a4c56d6bab10b (patch)
tree0842db7489691fc6e7cbb3cd6d3321dd0d4790b6 /src/hyprerror
parent1055e6bee677ef9c4ab4d09e43155e00a98a3b49 (diff)
downloadHyprland-4ad739ec63c9a11f0537a884ae2a4c56d6bab10b.tar.gz
Hyprland-4ad739ec63c9a11f0537a884ae2a4c56d6bab10b.zip
HookSystem: improve callback safety
Diffstat (limited to 'src/hyprerror')
-rw-r--r--src/hyprerror/HyprError.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hyprerror/HyprError.cpp b/src/hyprerror/HyprError.cpp
index de386097..7a9e9e87 100644
--- a/src/hyprerror/HyprError.cpp
+++ b/src/hyprerror/HyprError.cpp
@@ -6,7 +6,7 @@ CHyprError::CHyprError() {
m_fFadeOpacity.create(AVARTYPE_FLOAT, g_pConfigManager->getAnimationPropertyConfig("fadeIn"), AVARDAMAGE_NONE);
m_fFadeOpacity.registerVar();
- g_pHookSystem->hookDynamic("focusedMon", [&](void* self, SCallbackInfo& info, std::any param) {
+ static auto P = g_pHookSystem->hookDynamic("focusedMon", [&](void* self, SCallbackInfo& info, std::any param) {
if (!m_bIsCreated)
return;
@@ -14,7 +14,7 @@ CHyprError::CHyprError() {
m_bMonitorChanged = true;
});
- g_pHookSystem->hookDynamic("preRender", [&](void* self, SCallbackInfo& info, std::any param) {
+ static auto P2 = g_pHookSystem->hookDynamic("preRender", [&](void* self, SCallbackInfo& info, std::any param) {
if (!m_bIsCreated)
return;