Commit c6cc0d3a authored by Craig Watson's avatar Craig Watson

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).
parent d6503534
...@@ -74,8 +74,7 @@ int UBCustomCaptureWindow::execute(const QPixmap &pScreenPixmap) ...@@ -74,8 +74,7 @@ int UBCustomCaptureWindow::execute(const QPixmap &pScreenPixmap)
QDesktopWidget *desktop = QApplication::desktop(); QDesktopWidget *desktop = QApplication::desktop();
int currentScreen = desktop->screenNumber(QCursor::pos()); int currentScreen = desktop->screenNumber(QCursor::pos());
setGeometry(desktop->screenGeometry(currentScreen)); setGeometry(desktop->screenGeometry(currentScreen));
this->show();
UBPlatformUtils::showFullScreen(this);
setWindowOpacity(1.0); setWindowOpacity(1.0);
return exec(); return exec();
......
...@@ -501,12 +501,10 @@ QPixmap UBDesktopAnnotationController::getScreenPixmap() ...@@ -501,12 +501,10 @@ QPixmap UBDesktopAnnotationController::getScreenPixmap()
{ {
QDesktopWidget *desktop = QApplication::desktop(); 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() QScreen * screen = QApplication::primaryScreen();
, primaryScreenRect.y(), primaryScreenRect.width(), primaryScreenRect.height()); return screen->grabWindow(desktop->effectiveWinId());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment