mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 00:25:57 +01:00
parent
265c7924d8
commit
fa79aacea3
1 changed files with 5 additions and 2 deletions
|
@ -3,6 +3,9 @@
|
||||||
#include "../Compositor.hpp"
|
#include "../Compositor.hpp"
|
||||||
|
|
||||||
CConstraint::CConstraint(wlr_pointer_constraint_v1* constraint, CWLSurface* owner) : m_pOwner(owner), m_pConstraint(constraint) {
|
CConstraint::CConstraint(wlr_pointer_constraint_v1* constraint, CWLSurface* owner) : m_pOwner(owner), m_pConstraint(constraint) {
|
||||||
|
RASSERT(!constraint->data, "CConstraint: attempted to duplicate ownership");
|
||||||
|
|
||||||
|
constraint->data = this;
|
||||||
initSignals();
|
initSignals();
|
||||||
|
|
||||||
m_vCursorPosOnActivate = g_pInputManager->getMouseCoordsInternal();
|
m_vCursorPosOnActivate = g_pInputManager->getMouseCoordsInternal();
|
||||||
|
@ -97,13 +100,13 @@ void CConstraint::deactivate() {
|
||||||
|
|
||||||
m_bActive = false;
|
m_bActive = false;
|
||||||
|
|
||||||
wlr_pointer_constraint_v1_send_deactivated(m_pConstraint);
|
|
||||||
|
|
||||||
if (isLocked())
|
if (isLocked())
|
||||||
g_pCompositor->warpCursorTo(logicPositionHint(), true);
|
g_pCompositor->warpCursorTo(logicPositionHint(), true);
|
||||||
|
|
||||||
if (m_pConstraint->lifetime == ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT)
|
if (m_pConstraint->lifetime == ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT)
|
||||||
m_bDead = true;
|
m_bDead = true;
|
||||||
|
|
||||||
|
wlr_pointer_constraint_v1_send_deactivated(m_pConstraint);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConstraint::activate() {
|
void CConstraint::activate() {
|
||||||
|
|
Loading…
Reference in a new issue