1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix screenshot grabber for windows

This commit is contained in:
Nils Fenner 2015-09-27 23:57:01 +02:00
parent dd9f0763b7
commit fde63f1592
No known key found for this signature in database
GPG Key ID: 9591A163FF9BE04C

View File

@ -78,9 +78,9 @@ void ScreenshotGrabber::showGrabber()
this->window->grabKeyboard();
QRect fullGrabbedRect = screenGrab.rect();
QRect nr(QPoint(-1,-1), fullGrabbedRect.size());
QRect rec = QApplication::primaryScreen()->virtualGeometry();
this->window->setGeometry(nr);
this->window->setGeometry(rec);
this->scene->setSceneRect(fullGrabbedRect);
this->overlay->setRect(fullGrabbedRect);
@ -200,11 +200,13 @@ void ScreenshotGrabber::reject()
QPixmap ScreenshotGrabber::grabScreen()
{
QScreen* screen = QApplication::primaryScreen();
if (screen)
return screen->grabWindow(0);
return QPixmap();
QScreen* screen = QGuiApplication::primaryScreen();
QRect rec = screen->virtualGeometry();
return screen->grabWindow(QApplication::desktop()->winId(),
rec.x(),
rec.y(),
rec.width(),
rec.height());
}
void ScreenshotGrabber::beginRectChooser(QGraphicsSceneMouseEvent* event)