diff options
author | Vlad Zahorodnii <vlad.zahorodnii@kde.org> | 2022-11-22 20:58:22 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2022-11-30 10:38:42 +0100 |
commit | 471b2123400ef6936b5173553205549c7dd1a249 (patch) | |
tree | fc042b7687a35835e9fec245224188a483f7a703 | |
parent | 085f5b07a104c46f489969cea0a8a343bb8569e0 (diff) | |
download | qtwayland-471b2123400ef6936b5173553205549c7dd1a249.tar.gz |
Client: Honor QGuiApplication::overrideCursor()
If there's a QGuiApplication::overrideCursor(), QWindow::cursor() can
still return a different cursor. This can result in a wrong cursor when
the pointer enters a window.
Pick-to: 6.4 6.2 5.15
Fixes: QTBUG-75919
Change-Id: I015117b4b6d252b421ab14bd8f2a8f582f7cae52
Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r-- | src/client/qwaylandwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index c8d5121f..dcd80f37 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -1263,7 +1263,10 @@ void QWaylandWindow::setMouseCursor(QWaylandInputDevice *device, const QCursor & void QWaylandWindow::restoreMouseCursor(QWaylandInputDevice *device) { - setMouseCursor(device, window()->cursor()); + if (const QCursor *overrideCursor = QGuiApplication::overrideCursor()) + setMouseCursor(device, *overrideCursor); + else + setMouseCursor(device, window()->cursor()); } #endif |