summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 777f6bbe..e815579f 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -16,7 +16,6 @@
#include "TokenManager.hpp"
#include "eventLoop/EventLoopManager.hpp"
#include "debug/log/Logger.hpp"
-#include "../managers/HookSystemManager.hpp"
#include "../managers/input/InputManager.hpp"
#include "../managers/animation/DesktopAnimationManager.hpp"
#include "../managers/EventManager.hpp"
@@ -32,6 +31,7 @@
#include "../layout/algorithm/Algorithm.hpp"
#include "../layout/algorithm/tiled/master/MasterAlgorithm.hpp"
#include "../layout/algorithm/tiled/monocle/MonocleAlgorithm.hpp"
+#include "../event/EventBus.hpp"
#include <optional>
#include <iterator>
@@ -203,8 +203,7 @@ CKeybindManager::CKeybindManager() {
g_pEventLoopManager->addTimer(m_repeatKeyTimer);
}
- static auto P = g_pHookSystem->hookDynamic("configReloaded", [this](void* hk, SCallbackInfo& info, std::any param) {
- // clear cuz realloc'd
+ static auto P = Event::bus()->m_events.config.reloaded.listen([this] {
m_activeKeybinds.clear();
m_lastLongPressKeybind.reset();
m_pressedSpecialBinds.clear();
@@ -2215,7 +2214,7 @@ SDispatchResult CKeybindManager::setSubmap(std::string submap) {
m_currentSelectedSubmap.name = "";
Log::logger->log(Log::DEBUG, "Reset active submap to the default one.");
g_pEventManager->postEvent(SHyprIPCEvent{"submap", ""});
- EMIT_HOOK_EVENT("submap", m_currentSelectedSubmap.name);
+ Event::bus()->m_events.keybinds.submap.emit(m_currentSelectedSubmap.name);
return {};
}
@@ -2224,7 +2223,7 @@ SDispatchResult CKeybindManager::setSubmap(std::string submap) {
m_currentSelectedSubmap.name = submap;
Log::logger->log(Log::DEBUG, "Changed keybind submap to {}", submap);
g_pEventManager->postEvent(SHyprIPCEvent{"submap", submap});
- EMIT_HOOK_EVENT("submap", m_currentSelectedSubmap.name);
+ Event::bus()->m_events.keybinds.submap.emit(m_currentSelectedSubmap.name);
return {};
}
}
@@ -2584,7 +2583,7 @@ SDispatchResult CKeybindManager::pinActive(std::string args) {
g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), Desktop::View::RESERVED_EXTENTS | Desktop::View::INPUT_EXTENTS);
g_pEventManager->postEvent(SHyprIPCEvent{"pin", std::format("{:x},{}", rc<uintptr_t>(PWINDOW.get()), sc<int>(PWINDOW->m_pinned))});
- EMIT_HOOK_EVENT("pin", PWINDOW);
+ Event::bus()->m_events.window.pin.emit(PWINDOW);
g_pHyprRenderer->damageWindow(PWINDOW, true);