diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-05 18:47:27 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-09-05 18:47:27 +0200 |
commit | d892e6f721b0163dfb2f2ecf79d80ba62304a542 (patch) | |
tree | ccc1de7ece77bca11b20b3335126c337720d5e54 /src/gui/kernel | |
parent | 2997a60e1eaf0efbeb22516ae184fa93f278fec5 (diff) | |
parent | 657c2bfbeceda3faa2c7a76b4ccec6a65a3445a2 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
mkspecs/features/qt_common.prf
src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
Change-Id: I03b92b6b89ecc5a8db7c95f04ebb92ed198098a8
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwindow_p.h | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 5f71bdaded..18e8bcf99c 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2195,6 +2195,9 @@ void QWindowPrivate::deliverUpdateRequest() */ void QWindow::requestUpdate() { + Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread(), + "QWindow", "Updates can only be scheduled from the GUI (main) thread"); + Q_D(QWindow); if (d->updateRequestPending || !d->platformWindow) return; diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index 6d6d5a22ee..b8a9f5d3de 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -126,8 +126,14 @@ public: QPoint globalPosition() const { Q_Q(const QWindow); QPoint offset = q->position(); - for (const QWindow *p = q->parent(); p; p = p->parent()) - offset += p->position(); + for (const QWindow *p = q->parent(); p; p = p->parent()) { + if (p->type() != Qt::ForeignWindow) { + offset += p->position(); + } else { // QTBUG-43252, mapToGlobal() for foreign children. + offset += p->mapToGlobal(QPoint(0, 0)); + break; + } + } return offset; } |