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>
This commit is contained in:
parent
393fc2d4f5
commit
2f5c2ec12f
@ -2238,9 +2238,11 @@ 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();
|
||||
}
|
||||
|
||||
@ -2256,9 +2258,11 @@ 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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user