diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-12-11 13:25:33 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-02-18 11:01:09 +0000 |
commit | 2f5c2ec12f3c45a0806b5872c206a680e9fce014 (patch) | |
tree | 3c9d28839715af778b68f05b280da8b16831d0e9 | |
parent | 393fc2d4f5e0cbc6d6b3bd0e3c1624d5f9a15ee5 (diff) |
Use QPlatformWindow::mapToGlobal()/mapFromGlobal() for Qt::ForeignWindow.
Task-number: QTBUG-43252
Task-number: QTBUG-41186
Change-Id: I91654b6591585dec9748982a0686becf3f5e2718
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 4a88988322..33f0409216 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2238,10 +2238,12 @@ bool QWindow::nativeEvent(const QByteArray &eventType, void *message, long *resu QPoint QWindow::mapToGlobal(const QPoint &pos) const { Q_D(const QWindow); - if (d->platformWindow && d->platformWindow->isEmbedded(0)) + // QTBUG-43252, prefer platform implementation for foreign windows. + if (d->platformWindow + && (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded(0))) { return d->platformWindow->mapToGlobal(pos); - else - return pos + d_func()->globalPosition(); + } + return pos + d_func()->globalPosition(); } @@ -2256,10 +2258,12 @@ QPoint QWindow::mapToGlobal(const QPoint &pos) const QPoint QWindow::mapFromGlobal(const QPoint &pos) const { Q_D(const QWindow); - if (d->platformWindow && d->platformWindow->isEmbedded(0)) + // QTBUG-43252, prefer platform implementation for foreign windows. + if (d->platformWindow + && (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded(0))) { return d->platformWindow->mapFromGlobal(pos); - else - return pos - d_func()->globalPosition(); + } + return pos - d_func()->globalPosition(); } |