diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-01-31 13:29:14 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-02-09 14:10:17 +0000 |
commit | a57f2128b15d363b88c063325eac1d36c2ff1578 (patch) | |
tree | 8cfd5c6ded2a9e4adc1766905114342addb94751 /src/gui/kernel/qplatformwindow.cpp | |
parent | ee8b61bcf56e03aae0f8e346e70330276e221843 (diff) |
Add QPlatformWindow::isForeignWindow()
Simplifies code at call sites and allows for refactoring how to decide
if a window is foreign or not at a later point.
Change-Id: Icc51a83bac187f4975535366b53b4990832b6c82
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/kernel/qplatformwindow.cpp')
-rw-r--r-- | src/gui/kernel/qplatformwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 6fd2afb1aa..bfb2deff50 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -508,7 +508,7 @@ QPlatformScreen *QPlatformWindow::screenForGeometry(const QRect &newGeometry) co // QRect::center can return a value outside the rectangle if it's empty. // Apply mapToGlobal() in case it is a foreign/embedded window. QPoint center = newGeometry.isEmpty() ? newGeometry.topLeft() : newGeometry.center(); - if (window()->type() == Qt::ForeignWindow) + if (isForeignWindow()) center = mapToGlobal(center - newGeometry.topLeft()); if (!parent() && currentScreen && !currentScreen->geometry().contains(center)) { |