diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-11-30 17:46:56 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-12-03 08:15:29 +0100 |
commit | c034ad03ac6896b9fba8a72e01a1b7ec34cf0cd5 (patch) | |
tree | 60cab372abcc83dab6bc45841d3530b351ec3bbe /src/plugins/platforms/android | |
parent | 8e465c75fea7f71618a27743bac7faaccece6667 (diff) |
QPA: Set focus reason when window activation changes focus
QApplication hides the fact that the reason is never set by several
QPA plugins, but Quick items don't receive the correct reason on
Windows, Android, the offscreen plugin, and other platforms.
Add relevant scenario to the QFocusEvent test case, and fix the
plugins to always set the focus reason when handling window activation
changes. Exclude the minimal plugin from the test, it seems largely
unmaintained anyway.
Task-number: QTBUG-75862
Change-Id: I5404a225b387fc9a3851b6968d0777c687127ed1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/android')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformscreen.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp index 6a83827262..1463351c77 100644 --- a/src/plugins/platforms/android/qandroidplatformscreen.cpp +++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp @@ -158,7 +158,7 @@ void QAndroidPlatformScreen::addWindow(QAndroidPlatformWindow *window) } QWindow *w = topWindow(); - QWindowSystemInterface::handleWindowActivated(w); + QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason); topWindowChanged(w); } @@ -178,7 +178,7 @@ void QAndroidPlatformScreen::removeWindow(QAndroidPlatformWindow *window) } QWindow *w = topWindow(); - QWindowSystemInterface::handleWindowActivated(w); + QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason); topWindowChanged(w); } @@ -195,7 +195,7 @@ void QAndroidPlatformScreen::raise(QAndroidPlatformWindow *window) setDirty(window->geometry()); } QWindow *w = topWindow(); - QWindowSystemInterface::handleWindowActivated(w); + QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason); topWindowChanged(w); } @@ -212,7 +212,7 @@ void QAndroidPlatformScreen::lower(QAndroidPlatformWindow *window) setDirty(window->geometry()); } QWindow *w = topWindow(); - QWindowSystemInterface::handleWindowActivated(w); + QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason); topWindowChanged(w); } |