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/config/ConfigManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 54b73a3d..cd5b0ec8 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -42,7 +42,8 @@ #include "../managers/input/trackpad/gestures/FullscreenGesture.hpp" #include "../managers/input/trackpad/gestures/CursorZoomGesture.hpp" -#include "../managers/HookSystemManager.hpp" +#include "../event/EventBus.hpp" + #include "../protocols/types/ContentType.hpp" #include #include @@ -1066,7 +1067,7 @@ static void clearHlVersionVars() { } void CConfigManager::reload() { - EMIT_HOOK_EVENT("preConfigReload", nullptr); + Event::bus()->m_events.config.preReload.emit(); setDefaultAnimationVars(); resetHLConfig(); m_configCurrentPath = getMainConfigPath(); @@ -1458,7 +1459,7 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) { // update layouts Layout::Supplementary::algoMatcher()->updateWorkspaceLayouts(); - EMIT_HOOK_EVENT("configReloaded", nullptr); + Event::bus()->m_events.config.reloaded.emit(); if (g_pEventManager) g_pEventManager->postEvent(SHyprIPCEvent{"configreloaded", ""}); } @@ -1747,7 +1748,7 @@ void CConfigManager::performMonitorReload() { m_wantsMonitorReload = false; - EMIT_HOOK_EVENT("monitorLayoutChanged", nullptr); + Event::bus()->m_events.monitor.layoutChanged.emit(); } void* const* CConfigManager::getConfigValuePtr(const std::string& val) { -- cgit v1.2.3