From c6cc0d3a19d13b6255a6557488b31e63c16e3b61 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Fri, 11 Dec 2015 15:07:15 +0100 Subject: [PATCH] Fixed partial screenshot in desktop mode Note: the screenshot can only be taken on the primary display now (rather than on the display in which the mouse is, as was the case before). --- src/desktop/UBCustomCaptureWindow.cpp | 3 +-- src/desktop/UBDesktopAnnotationController.cpp | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/desktop/UBCustomCaptureWindow.cpp b/src/desktop/UBCustomCaptureWindow.cpp index 36e8969b..19e3434a 100644 --- a/src/desktop/UBCustomCaptureWindow.cpp +++ b/src/desktop/UBCustomCaptureWindow.cpp @@ -74,8 +74,7 @@ int UBCustomCaptureWindow::execute(const QPixmap &pScreenPixmap) QDesktopWidget *desktop = QApplication::desktop(); int currentScreen = desktop->screenNumber(QCursor::pos()); setGeometry(desktop->screenGeometry(currentScreen)); - - UBPlatformUtils::showFullScreen(this); + this->show(); setWindowOpacity(1.0); return exec(); diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 879b39e4..cc15b94a 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -501,12 +501,10 @@ QPixmap UBDesktopAnnotationController::getScreenPixmap() { QDesktopWidget *desktop = QApplication::desktop(); - // we capture the screen in which the mouse is. - const QRect primaryScreenRect = desktop->screenGeometry(QCursor::pos()); - QCoreApplication::flush(); - return QPixmap::grabWindow(desktop->winId(), primaryScreenRect.x() - , primaryScreenRect.y(), primaryScreenRect.width(), primaryScreenRect.height()); + QScreen * screen = QApplication::primaryScreen(); + return screen->grabWindow(desktop->effectiveWinId()); + }