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:
parent
dd9f0763b7
commit
fde63f1592
|
@ -78,9 +78,9 @@ void ScreenshotGrabber::showGrabber()
|
||||||
this->window->grabKeyboard();
|
this->window->grabKeyboard();
|
||||||
|
|
||||||
QRect fullGrabbedRect = screenGrab.rect();
|
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->scene->setSceneRect(fullGrabbedRect);
|
||||||
this->overlay->setRect(fullGrabbedRect);
|
this->overlay->setRect(fullGrabbedRect);
|
||||||
|
|
||||||
|
@ -200,11 +200,13 @@ void ScreenshotGrabber::reject()
|
||||||
|
|
||||||
QPixmap ScreenshotGrabber::grabScreen()
|
QPixmap ScreenshotGrabber::grabScreen()
|
||||||
{
|
{
|
||||||
QScreen* screen = QApplication::primaryScreen();
|
QScreen* screen = QGuiApplication::primaryScreen();
|
||||||
if (screen)
|
QRect rec = screen->virtualGeometry();
|
||||||
return screen->grabWindow(0);
|
return screen->grabWindow(QApplication::desktop()->winId(),
|
||||||
|
rec.x(),
|
||||||
return QPixmap();
|
rec.y(),
|
||||||
|
rec.width(),
|
||||||
|
rec.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenshotGrabber::beginRectChooser(QGraphicsSceneMouseEvent* event)
|
void ScreenshotGrabber::beginRectChooser(QGraphicsSceneMouseEvent* event)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user