topLevelAt(): convert to native coordinates.

QPlatformScreen works in native pixels and the
(device independent) coordinates from QWindow
needs to be converted.

Change-Id: I85ff45d66dc501e8c3c1c7a18f87448c92d79b9d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
This commit is contained in:
Morten Johan Sørvig 2015-11-05 12:29:43 +01:00
parent c87f3b2292
commit 3510c7324d

View File

@ -90,7 +90,7 @@ QWindow *QPlatformScreen::topLevelAt(const QPoint & pos) const
QWindowList list = QGuiApplication::topLevelWindows();
for (int i = list.size()-1; i >= 0; --i) {
QWindow *w = list[i];
if (w->isVisible() && w->geometry().contains(pos))
if (w->isVisible() && QHighDpi::toNativePixels(w->geometry(), w).contains(pos))
return w;
}