event: refactor HookSystem into a typed event bus (#13333)

Refactors the old HookSystem into a typed event bus with clear
separation,
discovery and types.
This commit is contained in:
Vaxry 2026-02-22 23:30:10 +00:00 committed by GitHub
parent b4ee4674f9
commit b88813c7ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 493 additions and 516 deletions

View file

@ -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 <cstddef>
#include <cstdint>
@ -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) {