From 6c8cd3fb3f9b9ded759f83b7c9997acb83e29e73 Mon Sep 17 00:00:00 2001 From: ga3an Date: Wed, 8 Apr 2026 01:08:07 +0200 Subject: [PATCH] fix: removed unncessary(I wish it's) pointer focus hack in activate(), it's my first time in a codeBase so... --- src/protocols/PointerConstraints.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/protocols/PointerConstraints.cpp b/src/protocols/PointerConstraints.cpp index a78f3548b..c133be293 100644 --- a/src/protocols/PointerConstraints.cpp +++ b/src/protocols/PointerConstraints.cpp @@ -125,13 +125,6 @@ void CPointerConstraint::activate() { if (m_dead || m_active) return; - // TODO: hack, probably not a super duper great idea - if (g_pSeatManager->m_state.pointerFocus != m_hlSurface->resource()) { - const auto SURFBOX = m_hlSurface->getSurfaceBoxGlobal(); - const auto LOCAL = SURFBOX.has_value() ? logicPositionHint() - SURFBOX->pos() : Vector2D{}; - g_pSeatManager->setPointerFocus(m_hlSurface->resource(), LOCAL); - } - if (m_locked) m_resourceLocked->sendLocked(); else @@ -243,8 +236,9 @@ void CPointerConstraintsProtocol::onNewConstraint(SP constra g_pInputManager->m_constraints.emplace_back(constraint); - if (Desktop::focusState()->surface() == OWNER->resource()) + if (Desktop::focusState()->surface() == OWNER->resource()){ constraint->activate(); + } } void CPointerConstraintsProtocol::onLockPointer(CZwpPointerConstraintsV1* pMgr, uint32_t id, wl_resource* surface, wl_resource* pointer, wl_resource* region,