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:
parent
c87f3b2292
commit
3510c7324d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user