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).
preferencesAboutTextFull
Craig Watson 10 years ago
parent d6503534db
commit c6cc0d3a19
  1. 3
      src/desktop/UBCustomCaptureWindow.cpp
  2. 8
      src/desktop/UBDesktopAnnotationController.cpp

@ -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()
{ {
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());
} }

Loading…
Cancel
Save