diff options
author | Vaxry <[email protected]> | 2024-04-26 23:55:41 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-04-27 03:17:04 +0100 |
commit | 25aec3ac8ce65ed224f025f8f6dfef73780577a4 (patch) | |
tree | 9fa63de1670bd2f535f3bc237800fc6b7a81f646 /src/desktop/WLSurface.cpp | |
parent | f94264928a8ab4da8759d4ded25a46af44451d38 (diff) | |
download | Hyprland-25aec3ac8ce65ed224f025f8f6dfef73780577a4.tar.gz Hyprland-25aec3ac8ce65ed224f025f8f6dfef73780577a4.zip |
pointer-constraints: move to new impl
Diffstat (limited to 'src/desktop/WLSurface.cpp')
-rw-r--r-- | src/desktop/WLSurface.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/desktop/WLSurface.cpp b/src/desktop/WLSurface.cpp index b102c5ce..4c2f6c84 100644 --- a/src/desktop/WLSurface.cpp +++ b/src/desktop/WLSurface.cpp @@ -103,6 +103,8 @@ void CWLSurface::destroy() { if (!m_pWLRSurface) return; + events.destroy.emit(); + m_pConstraint.reset(); hyprListener_destroy.removeCallback(); @@ -182,15 +184,14 @@ std::optional<CBox> CWLSurface::getSurfaceBoxGlobal() { return {}; } -void CWLSurface::appendConstraint(wlr_pointer_constraint_v1* constraint) { - m_pConstraint = std::make_unique<CConstraint>(constraint, this); +void CWLSurface::appendConstraint(std::weak_ptr<CPointerConstraint> constraint) { + m_pConstraint = constraint; } void CWLSurface::onCommit() { - if (m_pConstraint) - m_pConstraint->onCommit(); + ; } -CConstraint* CWLSurface::constraint() { - return m_pConstraint.get(); +std::shared_ptr<CPointerConstraint> CWLSurface::constraint() { + return m_pConstraint.lock(); } |