diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-02-22 23:30:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-22 23:30:10 +0000 |
| commit | b88813c7efa4b7b0c5fe01471c5fa5b67a61dc7e (patch) | |
| tree | 4454e82bc033d7e28a23ee372d0e3f48341d0aaa /src/desktop/history/WindowHistoryTracker.cpp | |
| parent | b4ee4674f9a74e3d602c7fb17bc09f79d221583c (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/desktop/history/WindowHistoryTracker.cpp')
| -rw-r--r-- | src/desktop/history/WindowHistoryTracker.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/desktop/history/WindowHistoryTracker.cpp b/src/desktop/history/WindowHistoryTracker.cpp index edaa2b5e..1dd32164 100644 --- a/src/desktop/history/WindowHistoryTracker.cpp +++ b/src/desktop/history/WindowHistoryTracker.cpp @@ -1,7 +1,7 @@ #include "WindowHistoryTracker.hpp" -#include "../../managers/HookSystemManager.hpp" #include "../view/Window.hpp" +#include "../../event/EventBus.hpp" using namespace Desktop; using namespace Desktop::History; @@ -12,18 +12,12 @@ SP<CWindowHistoryTracker> History::windowTracker() { } CWindowHistoryTracker::CWindowHistoryTracker() { - static auto P = g_pHookSystem->hookDynamic("openWindowEarly", [this](void* self, SCallbackInfo& info, std::any data) { - auto window = std::any_cast<PHLWINDOW>(data); - + static auto P = Event::bus()->m_events.window.openEarly.listen([this](PHLWINDOW pWindow) { // add a last track - m_history.insert(m_history.begin(), window); + m_history.insert(m_history.begin(), pWindow); }); - static auto P1 = g_pHookSystem->hookDynamic("activeWindow", [this](void* self, SCallbackInfo& info, std::any data) { - auto window = std::any_cast<Desktop::View::SWindowActiveEvent>(data).window; - - track(window); - }); + static auto P1 = Event::bus()->m_events.window.active.listen([this](PHLWINDOW window, uint8_t reason) { track(window); }); } void CWindowHistoryTracker::track(PHLWINDOW w) { |
