correct position of QScreen geometry on HiDPI multi-headed setup
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -126,6 +126,8 @@ CaptureWidget::CaptureWidget(const uint id,
|
||||
if (m_context.fullscreen) {
|
||||
for (QScreen* const screen : QGuiApplication::screens()) {
|
||||
QRect r = screen->geometry();
|
||||
r.moveTo(r.x() / screen->devicePixelRatio(),
|
||||
r.y() / screen->devicePixelRatio());
|
||||
#ifdef Q_OS_WIN
|
||||
r.moveTo(r.topLeft() - topLeft);
|
||||
#endif
|
||||
@@ -600,6 +602,10 @@ void CaptureWidget::initPanel()
|
||||
QRect panelRect = rect();
|
||||
if (m_context.fullscreen) {
|
||||
panelRect = QGuiApplication::primaryScreen()->geometry();
|
||||
auto devicePixelRatio =
|
||||
QGuiApplication::primaryScreen()->devicePixelRatio();
|
||||
panelRect.moveTo(panelRect.x() / devicePixelRatio,
|
||||
panelRect.y() / devicePixelRatio);
|
||||
}
|
||||
|
||||
ConfigHandler config;
|
||||
|
||||
Reference in New Issue
Block a user