diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-04-26 23:55:41 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-04-27 03:17:04 +0100 |
| commit | 25aec3ac8ce65ed224f025f8f6dfef73780577a4 (patch) | |
| tree | 9fa63de1670bd2f535f3bc237800fc6b7a81f646 /src/managers/input/InputManager.cpp | |
| parent | f94264928a8ab4da8759d4ded25a46af44451d38 (diff) | |
pointer-constraints: move to new impl
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index b5d6bb5c..b930838b 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -7,6 +7,7 @@ #include "../../protocols/CursorShape.hpp" #include "../../protocols/IdleInhibit.hpp" #include "../../protocols/RelativePointer.hpp" +#include "../../protocols/PointerConstraints.hpp" CInputManager::CInputManager() { m_sListeners.setCursorShape = PROTO::cursorShape->events.setShape.registerListener([this](std::any data) { @@ -193,7 +194,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { return; } else - Debug::log(ERR, "BUG THIS: Null SURF/CONSTRAINT in mouse refocus. Ignoring constraints. {:x} {:x}", (uintptr_t)SURF, (uintptr_t)CONSTRAINT); + Debug::log(ERR, "BUG THIS: Null SURF/CONSTRAINT in mouse refocus. Ignoring constraints. {:x} {:x}", (uintptr_t)SURF, (uintptr_t)CONSTRAINT.get()); } // update stuff @@ -1298,16 +1299,26 @@ void CInputManager::unconstrainMouse() { return; for (auto& c : m_vConstraints) { - if (!c->active()) + const auto C = c.lock(); + + if (!C) + continue; + + if (!C->isActive()) continue; - c->deactivate(); + C->deactivate(); } } bool CInputManager::isConstrained() { for (auto& c : m_vConstraints) { - if (!c->active() || c->owner()->wlr() != g_pCompositor->m_pLastFocus) + const auto C = c.lock(); + + if (!C) + continue; + + if (!C->isActive() || C->owner()->wlr() != g_pCompositor->m_pLastFocus) continue; return true; |
