correct position of QScreen geometry on HiDPI multi-headed setup

This commit is contained in:
Peter Cai
2020-09-25 06:47:38 +08:00
committed by borgmanJeremy
parent e298d56f32
commit e1214e23e5
2 changed files with 10 additions and 1 deletions

View File

@@ -90,7 +90,10 @@ QPixmap ScreenGrabber::grabEntireDesktop(bool& ok)
QRect geometry;
for (QScreen* const screen : QGuiApplication::screens()) {
geometry = geometry.united(screen->geometry());
QRect scrRect = screen->geometry();
scrRect.moveTo(scrRect.x() / screen->devicePixelRatio(),
scrRect.y() / screen->devicePixelRatio());
geometry = geometry.united(scrRect);
}
QPixmap p(QApplication::primaryScreen()->grabWindow(