summaryrefslogtreecommitdiff
path: root/src/managers/ANRManager.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-02-22 23:30:10 +0000
committerGitHub <noreply@github.com>2026-02-22 23:30:10 +0000
commitb88813c7efa4b7b0c5fe01471c5fa5b67a61dc7e (patch)
tree4454e82bc033d7e28a23ee372d0e3f48341d0aaa /src/managers/ANRManager.cpp
parentb4ee4674f9a74e3d602c7fb17bc09f79d221583c (diff)
event: refactor HookSystem into a typed event bus (#13333)
Refactors the old HookSystem into a typed event bus with clear separation, discovery and types.
Diffstat (limited to 'src/managers/ANRManager.cpp')
-rw-r--r--src/managers/ANRManager.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/managers/ANRManager.cpp b/src/managers/ANRManager.cpp
index 43d2d080..9f613df8 100644
--- a/src/managers/ANRManager.cpp
+++ b/src/managers/ANRManager.cpp
@@ -3,13 +3,13 @@
#include "../helpers/fs/FsUtils.hpp"
#include "../debug/log/Logger.hpp"
#include "../macros.hpp"
-#include "HookSystemManager.hpp"
#include "../Compositor.hpp"
#include "../protocols/XDGShell.hpp"
#include "./eventLoop/EventLoopManager.hpp"
#include "../config/ConfigValue.hpp"
#include "../xwayland/XSurface.hpp"
#include "../i18n/Engine.hpp"
+#include "../event/EventBus.hpp"
using namespace Hyprutils::OS;
@@ -26,9 +26,7 @@ CANRManager::CANRManager() {
m_active = true;
- static auto P = g_pHookSystem->hookDynamic("openWindow", [this](void* self, SCallbackInfo& info, std::any data) {
- auto window = std::any_cast<PHLWINDOW>(data);
-
+ static auto P = Event::bus()->m_events.window.open.listen([this](PHLWINDOW window) {
for (const auto& d : m_data) {
// Window is ANR dialog
if (d->isRunning() && d->dialogBox->getPID() == window->getPID())
@@ -41,9 +39,7 @@ CANRManager::CANRManager() {
m_data.emplace_back(makeShared<SANRData>(window));
});
- static auto P1 = g_pHookSystem->hookDynamic("closeWindow", [this](void* self, SCallbackInfo& info, std::any data) {
- auto window = std::any_cast<PHLWINDOW>(data);
-
+ static auto P1 = Event::bus()->m_events.window.close.listen([this](PHLWINDOW window) {
for (const auto& d : m_data) {
if (!d->fitsWindow(window))
continue;