summaryrefslogtreecommitdiff
path: root/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.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/layout/algorithm/tiled/monocle/MonocleAlgorithm.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/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp')
-rw-r--r--src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp b/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp
index 65533e71..6e9e822c 100644
--- a/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp
+++ b/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp
@@ -10,6 +10,7 @@
#include "../../../../desktop/history/WindowHistoryTracker.hpp"
#include "../../../../helpers/Monitor.hpp"
#include "../../../../Compositor.hpp"
+#include "../../../../event/EventBus.hpp"
#include <hyprutils/string/VarList2.hpp>
#include <hyprutils/string/ConstVarList.hpp>
@@ -22,16 +23,14 @@ using namespace Layout::Tiled;
CMonocleAlgorithm::CMonocleAlgorithm() {
// hook into focus changes to bring focused window to front
- m_focusCallback = g_pHookSystem->hookDynamic("activeWindow", [this](void* hk, SCallbackInfo& info, std::any param) {
- const auto PWINDOW = std::any_cast<Desktop::View::SWindowActiveEvent>(param).window;
-
- if (!PWINDOW)
+ m_focusCallback = Event::bus()->m_events.window.active.listen([this](PHLWINDOW pWindow, Desktop::eFocusReason reason) {
+ if (!pWindow)
return;
- if (!PWINDOW->m_workspace->isVisible())
+ if (!pWindow->m_workspace->isVisible())
return;
- const auto TARGET = PWINDOW->layoutTarget();
+ const auto TARGET = pWindow->layoutTarget();
if (!TARGET)
return;