diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-30 09:09:03 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-31 20:33:56 +0000 |
commit | 46fc3d3729df9e81e42f87c46907d6eb81a0c669 (patch) | |
tree | a3fff6e5a94ee3e52036d35146fa59ee893cdcc8 /src/plugins/platforms/windows/qwindowswindow.cpp | |
parent | e386cd03d12e401b9e3945602e9621a86009fa11 (diff) |
Windows QPA: Fix override cursor being cleared when crossing window borders
Override cursors can be modified externally when for example crossing
window borders. Add helper function to enforce the cursor again to
QWindowsWindow::applyCursor() which is called for enter events.
Task-number: QTBUG-69637
Change-Id: Ibea4da9f2aac81377002b626daae64b1102f6c2b
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 3909c64c53..aa40d422fb 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2419,8 +2419,11 @@ static inline bool applyNewCursor(const QWindow *w) void QWindowsWindow::applyCursor() { - if (static_cast<const QWindowsCursor *>(screen()->cursor())->hasOverrideCursor()) + if (QWindowsCursor::hasOverrideCursor()) { + if (isTopLevel()) + QWindowsCursor::enforceOverrideCursor(); return; + } #ifndef QT_NO_CURSOR if (m_cursor->isNull()) { // Recurse up to parent with non-null cursor. Set default for toplevel. if (const QWindow *p = window()->parent()) { |