summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-27 13:06:38 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-27 13:06:38 +0200
commit572200989b224ad68e7b8ae4c0aecceb6ca871a2 (patch)
tree5591e8e6c17df64674aa79227ad6b70374c169ff /src/widgets/kernel/qwidget.cpp
parent7ed024226faa9c53c6bad96fb6c9f38a22d25751 (diff)
parent241eca33ed45f112feed18c6256c31e606f47796 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: configure mkspecs/features/create_cmake.prf Change-Id: I94aea83b83833395d5db399209e0e51b92ef23b5
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r--src/widgets/kernel/qwidget.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 3eb949f814..a0c723fa0d 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -104,6 +104,8 @@
#include "qtabwidget.h" // Needed in inTabWidget()
#endif // QT_KEYPAD_NAVIGATION
+#include "qwindowcontainer_p.h"
+
// widget/widget data creation count
//#define QWIDGET_EXTRA_DEBUG
@@ -1549,10 +1551,11 @@ void QWidgetPrivate::createTLExtra()
x->inTopLevelResize = false;
x->inRepaint = false;
x->embedded = 0;
+ x->window = 0;
+ x->screenIndex = 0;
#ifdef Q_WS_MAC
x->wasMaximized = false;
#endif // Q_WS_MAC
- createTLSysExtra();
#ifdef QWIDGET_EXTRA_DEBUG
static int count = 0;
qDebug() << "tlextra" << ++count;
@@ -6252,6 +6255,17 @@ bool QWidget::isActiveWindow() const
}
}
+ // Check for an active window container
+ if (QWindow *ww = QGuiApplication::focusWindow()) {
+ while (ww) {
+ QWidgetWindow *qww = qobject_cast<QWidgetWindow *>(ww);
+ QWindowContainer *qwc = qww ? qobject_cast<QWindowContainer *>(qww->widget()) : 0;
+ if (qwc && qwc->topLevelWidget() == tlw)
+ return true;
+ ww = ww->parent();
+ }
+ }
+
// Check if platform adaptation thinks the window is active. This is necessary for
// example in case of ActiveQt servers that are embedded into another application.
// Those are separate processes that are not part of the parent application Qt window/widget
@@ -10112,6 +10126,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break; }
case Qt::WA_NativeWindow: {
d->createTLExtra();
+ if (on)
+ d->createTLSysExtra();
#ifndef QT_NO_IM
QWidget *focusWidget = d->effectiveFocusWidget();
if (on && !internalWinId() && hasFocus()