protocols: ensure PointerConstraints activation occurs only after attched to InputManager (#10096)

This commit is contained in:
Bruno Krügel 2025-04-18 20:16:30 -03:00 committed by GitHub
parent 51afc2c291
commit f48ee7a3d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,9 +93,6 @@ void CPointerConstraint::sharedConstructions() {
} }
cursorPosOnActivate = g_pInputManager->getMouseCoordsInternal(); cursorPosOnActivate = g_pInputManager->getMouseCoordsInternal();
if (g_pCompositor->m_pLastFocus == pHLSurface->resource())
activate();
} }
bool CPointerConstraint::good() { bool CPointerConstraint::good() {
@ -244,6 +241,9 @@ void CPointerConstraintsProtocol::onNewConstraint(SP<CPointerConstraint> constra
OWNER->appendConstraint(constraint); OWNER->appendConstraint(constraint);
g_pInputManager->m_vConstraints.emplace_back(constraint); g_pInputManager->m_vConstraints.emplace_back(constraint);
if (g_pCompositor->m_pLastFocus == OWNER->resource())
constraint->activate();
} }
void CPointerConstraintsProtocol::onLockPointer(CZwpPointerConstraintsV1* pMgr, uint32_t id, wl_resource* surface, wl_resource* pointer, wl_resource* region, void CPointerConstraintsProtocol::onLockPointer(CZwpPointerConstraintsV1* pMgr, uint32_t id, wl_resource* surface, wl_resource* pointer, wl_resource* region,