From b88813c7efa4b7b0c5fe01471c5fa5b67a61dc7e Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sun, 22 Feb 2026 23:30:10 +0000 Subject: event: refactor HookSystem into a typed event bus (#13333) Refactors the old HookSystem into a typed event bus with clear separation, discovery and types. --- src/plugins/PluginAPI.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/plugins/PluginAPI.cpp') diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp index 57081183..5f89da53 100644 --- a/src/plugins/PluginAPI.cpp +++ b/src/plugins/PluginAPI.cpp @@ -2,7 +2,6 @@ #include "../Compositor.hpp" #include "../debug/HyprCtl.hpp" #include "../plugins/PluginSystem.hpp" -#include "../managers/HookSystemManager.hpp" #include "../managers/eventLoop/EventLoopManager.hpp" #include "../config/ConfigManager.hpp" #include "../debug/HyprNotificationOverlay.hpp" @@ -38,9 +37,9 @@ APICALL SP HyprlandAPI::registerCallbackDynamic(HANDLE handle, if (!PLUGIN) return nullptr; - auto PFN = g_pHookSystem->hookDynamic(event, fn, handle); - PLUGIN->m_registeredCallbacks.emplace_back(std::make_pair<>(event, WP(PFN))); - return PFN; + //auto PFN = g_pHookSystem->hookDynamic(event, fn, handle); + //PLUGIN->m_registeredCallbacks.emplace_back(std::make_pair<>(event, WP(PFN))); + return nullptr; } APICALL bool HyprlandAPI::unregisterCallback(HANDLE handle, SP fn) { @@ -49,8 +48,8 @@ APICALL bool HyprlandAPI::unregisterCallback(HANDLE handle, SP if (!PLUGIN) return false; - g_pHookSystem->unhook(fn); - std::erase_if(PLUGIN->m_registeredCallbacks, [&](const auto& other) { return other.second.lock() == fn; }); + //g_pHookSystem->unhook(fn); + // std::erase_if(PLUGIN->m_registeredCallbacks, [&](const auto& other) { return other.second.lock() == fn; }); return true; } -- cgit v1.2.3