summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-10-08 10:56:25 +0200
committerLiang Qi <liang.qi@qt.io>2018-10-08 10:56:25 +0200
commit7344987c20d13710af89300f9b39e06397ec592a (patch)
tree4c12e46adefd3aee9d2ce479923fe56bab483764 /src/widgets/kernel/qwidget.cpp
parent8ad5967793f43bda2c38e3f9dddd3d2b6fef5390 (diff)
parent29208fa07c1b9f656ea2535696828385b7832226 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: I3a503b44ae413fbc0a90f4af70b8f84daffd86ad
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r--src/widgets/kernel/qwidget.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index a1a861e216..6753c35cfc 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1572,7 +1572,7 @@ QWidget::~QWidget()
#endif
#ifndef QT_NO_GESTURES
- if (QGestureManager *manager = QGestureManager::instance()) {
+ if (QGestureManager *manager = QGestureManager::instance(QGestureManager::DontForceCreation)) {
// \forall Qt::GestureType type : ungrabGesture(type) (inlined)
for (auto it = d->gestureContext.keyBegin(), end = d->gestureContext.keyEnd(); it != end; ++it)
manager->cleanupCachedGestures(this, *it);
@@ -6600,9 +6600,12 @@ QWidget *QWidgetPrivate::deepestFocusProxy() const
void QWidgetPrivate::setFocus_sys()
{
Q_Q(QWidget);
- // Embedded native widget may have taken the focus; get it back to toplevel if that is the case
+ // Embedded native widget may have taken the focus; get it back to toplevel
+ // if that is the case (QTBUG-25852)
const QWidget *topLevel = q->window();
- if (topLevel->windowType() != Qt::Popup) {
+ // Do not activate in case the popup menu opens another application (QTBUG-70810).
+ if (QGuiApplication::applicationState() == Qt::ApplicationActive
+ && topLevel->windowType() != Qt::Popup) {
if (QWindow *nativeWindow = q->window()->windowHandle()) {
if (nativeWindow != QGuiApplication::focusWindow()
&& q->testAttribute(Qt::WA_WState_Created)) {