diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-03-19 18:55:17 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-03-19 18:55:17 +0000 |
| commit | c32b2331d10605488d3f901189c975513c2823ad (patch) | |
| tree | 2bf3ae1ba464704e8d01dc79d5aaa0965506fd63 /src/desktop/Constraint.cpp | |
| parent | bcba3951f45f11245d424274130eb3a0ac790d93 (diff) | |
constraint: set active flag before propagating props
fixes #5170
Diffstat (limited to 'src/desktop/Constraint.cpp')
| -rw-r--r-- | src/desktop/Constraint.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/desktop/Constraint.cpp b/src/desktop/Constraint.cpp index 662f0990..2109ef1c 100644 --- a/src/desktop/Constraint.cpp +++ b/src/desktop/Constraint.cpp @@ -92,9 +92,10 @@ void CConstraint::deactivate() { if (!m_bActive) return; - wlr_pointer_constraint_v1_send_deactivated(m_pConstraint); m_bActive = false; + wlr_pointer_constraint_v1_send_deactivated(m_pConstraint); + if (isLocked()) g_pCompositor->warpCursorTo(logicPositionHint(), true); @@ -106,6 +107,8 @@ void CConstraint::activate() { if (m_bActive || m_bDead) return; + m_bActive = true; + // TODO: hack, probably not a super duper great idea if (g_pCompositor->m_sSeat.seat->pointer_state.focused_surface != m_pOwner->wlr()) { const auto SURFBOX = m_pOwner->getSurfaceBoxGlobal(); @@ -115,7 +118,6 @@ void CConstraint::activate() { g_pCompositor->warpCursorTo(logicPositionHint(), true); wlr_pointer_constraint_v1_send_activated(m_pConstraint); - m_bActive = true; } bool CConstraint::active() { |
