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
This commit is contained in:
David Edmundson 2022-09-26 10:37:53 +01:00
parent 0a22d390d6
commit e924b1cb23

View file

@ -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;
}
}