From e924b1cb231632e53a405a04a24ae63538aa37e1 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 26 Sep 2022 10:37:53 +0100 Subject: [PATCH] Fix clamping in screenContainsPos QRect.contains(somePointF.toPoint()) will round the values. This is problematic for the case of a mouse being at -0.4, we will consider it in bounds for the screen, but obviously this doesn't match any surfaces. The detection and confineToBoundingBox need to behave the same and floor. BUG: 459328 --- src/pointer_input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp index 2de29c26e6..6632524e97 100644 --- a/src/pointer_input.cpp +++ b/src/pointer_input.cpp @@ -55,7 +55,8 @@ static bool screenContainsPos(const QPointF &pos) { const auto outputs = workspace()->outputs(); for (const Output *output : outputs) { - if (output->geometry().contains(pos.toPoint())) { + if (output->geometry().contains(QPoint(std::floor(pos.x()), + std::floor(pos.y())))) { return true; } }