input-capture: don't send motion when the input is locked (like inside a 3d game)

This commit is contained in:
Gwilherm Folliot 2024-12-17 20:41:27 +01:00
parent 21a7251d02
commit 0a1f95b657
No known key found for this signature in database
GPG key ID: 90236D3623DCD660

View file

@ -702,7 +702,9 @@ void CPointerManager::move(const Vector2D& deltaLogical) {
const auto oldPos = pointerPos; const auto oldPos = pointerPos;
auto newPos = oldPos + Vector2D{std::isnan(deltaLogical.x) ? 0.0 : deltaLogical.x, std::isnan(deltaLogical.y) ? 0.0 : deltaLogical.y}; auto newPos = oldPos + Vector2D{std::isnan(deltaLogical.x) ? 0.0 : deltaLogical.x, std::isnan(deltaLogical.y) ? 0.0 : deltaLogical.y};
PROTO::inputCapture->sendMotion(newPos, deltaLogical);
if (!g_pInputManager->isLocked())
PROTO::inputCapture->sendMotion(newPos, deltaLogical);
if (PROTO::inputCapture->isCaptured()) if (PROTO::inputCapture->isCaptured())
return; return;