Client: fix mouse cursor restoring check when cursor enters the content area

In a02c408afc1ec3713d26f133277cbba2d207f102,
windowContentGeometry was changed by adding shadow margins,
but the check ensures that the point inside the content area
rather than the decoration and windowContentGeometry is smaller
than the decoration geometry now as it excludes the shadow.

Creating the geometry from surfaceSize fixes it.

Pick-to: 6.3 6.2
Change-Id: If20a387b6864c1bc961352654f827a45cee77bd1
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
This commit is contained in:
Ilya Fedin 2022-04-12 05:46:20 +04:00
parent d112d4ec8e
commit bb3eeb085c

View File

@ -1038,7 +1038,7 @@ void QWaylandWindow::handleMouse(QWaylandInputDevice *inputDevice, const QWaylan
#if QT_CONFIG(cursor)
if (e.type == QEvent::Enter) {
QRect contentGeometry = windowContentGeometry().marginsRemoved(clientSideMargins());
QRect contentGeometry = QRect(QPoint(), surfaceSize()).marginsRemoved(clientSideMargins());
if (contentGeometry.contains(e.local.toPoint()))
restoreMouseCursor(inputDevice);
}