diff options
author | Vaxry <[email protected]> | 2024-04-20 20:16:42 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-04-20 20:16:42 +0100 |
commit | 4ad739ec63c9a11f0537a884ae2a4c56d6bab10b (patch) | |
tree | 0842db7489691fc6e7cbb3cd6d3321dd0d4790b6 /src/protocols/XDGOutput.cpp | |
parent | 1055e6bee677ef9c4ab4d09e43155e00a98a3b49 (diff) | |
download | Hyprland-4ad739ec63c9a11f0537a884ae2a4c56d6bab10b.tar.gz Hyprland-4ad739ec63c9a11f0537a884ae2a4c56d6bab10b.zip |
HookSystem: improve callback safety
Diffstat (limited to 'src/protocols/XDGOutput.cpp')
-rw-r--r-- | src/protocols/XDGOutput.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocols/XDGOutput.cpp b/src/protocols/XDGOutput.cpp index 265b88ed..551d9d90 100644 --- a/src/protocols/XDGOutput.cpp +++ b/src/protocols/XDGOutput.cpp @@ -33,9 +33,9 @@ void CXDGOutputProtocol::bindManager(wl_client* client, void* data, uint32_t ver } CXDGOutputProtocol::CXDGOutputProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) { - g_pHookSystem->hookDynamic("monitorLayoutChanged", [this](void* self, SCallbackInfo& info, std::any param) { this->updateAllOutputs(); }); - g_pHookSystem->hookDynamic("configReloaded", [this](void* self, SCallbackInfo& info, std::any param) { this->updateAllOutputs(); }); - g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, SCallbackInfo& info, std::any param) { + static auto P = g_pHookSystem->hookDynamic("monitorLayoutChanged", [this](void* self, SCallbackInfo& info, std::any param) { this->updateAllOutputs(); }); + static auto P2 = g_pHookSystem->hookDynamic("configReloaded", [this](void* self, SCallbackInfo& info, std::any param) { this->updateAllOutputs(); }); + static auto P3 = g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, SCallbackInfo& info, std::any param) { const auto PMONITOR = std::any_cast<CMonitor*>(param); for (auto& o : m_vXDGOutputs) { if (o->monitor == PMONITOR) |