From 7e2b463853e30db548fb720d0bad622e388503fe Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 22 Dec 2015 17:07:06 +0100 Subject: [PATCH] Fixed screenshot taking pixmap of entire desktop in multiscreen environment --- src/desktop/UBDesktopAnnotationController.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index cc15b94a..4f7a0a76 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -500,11 +500,12 @@ void UBDesktopAnnotationController::screenCapture() QPixmap UBDesktopAnnotationController::getScreenPixmap() { QDesktopWidget *desktop = QApplication::desktop(); - - QScreen * screen = QApplication::primaryScreen(); - return screen->grabWindow(desktop->effectiveWinId()); + QRect rect = desktop->screenGeometry(QCursor::pos()); + + return screen->grabWindow(desktop->effectiveWinId(), + rect.x(), rect.y(), rect.width(), rect.height()); }