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/protocols/PresentationTime.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/protocols/PresentationTime.cpp')
| -rw-r--r-- | src/protocols/PresentationTime.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/protocols/PresentationTime.cpp b/src/protocols/PresentationTime.cpp index 42c0e34c..456ad724 100644 --- a/src/protocols/PresentationTime.cpp +++ b/src/protocols/PresentationTime.cpp @@ -1,7 +1,7 @@ #include "PresentationTime.hpp" #include <algorithm> #include "../helpers/Monitor.hpp" -#include "../managers/HookSystemManager.hpp" +#include "../event/EventBus.hpp" #include "core/Compositor.hpp" #include "core/Output.hpp" #include <aquamarine/output/Output.hpp> @@ -77,10 +77,8 @@ void CPresentationFeedback::sendQueued(WP<CQueuedPresentationData> data, const t } CPresentationProtocol::CPresentationProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) { - static auto P = g_pHookSystem->hookDynamic("monitorRemoved", [this](void* self, SCallbackInfo& info, std::any param) { - const auto PMONITOR = PHLMONITORREF{std::any_cast<PHLMONITOR>(param)}; - std::erase_if(m_queue, [PMONITOR](const auto& other) { return !other->m_surface || other->m_monitor == PMONITOR; }); - }); + static auto P = Event::bus()->m_events.monitor.removed.listen( + [this](PHLMONITOR mon) { std::erase_if(m_queue, [mon](const auto& other) { return !other->m_surface || other->m_monitor == mon; }); }); } void CPresentationProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) { |
