summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformwindow.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-01-31 13:29:14 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-02-09 14:10:17 +0000
commita57f2128b15d363b88c063325eac1d36c2ff1578 (patch)
tree8cfd5c6ded2a9e4adc1766905114342addb94751 /src/gui/kernel/qplatformwindow.cpp
parentee8b61bcf56e03aae0f8e346e70330276e221843 (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.cpp2
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)) {