diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 27f558c5..27c5d75b 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -465,6 +465,7 @@ void UBApplicationController::showDesktop(bool dontSwitchFrontProcess) if (mMirror) { QRect rect = qApp->desktop()->screenGeometry(desktopWidgetIndex); + rect.moveTo(0, 0); mMirror->setSourceRect(rect); } diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index f24e9211..4256379d 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -236,7 +236,7 @@ void UBDisplayManager::positionScreens() if (mDisplayWidget && mDisplayScreenIndex > -1) { - mDisplayWidget->hide(); + mDisplayWidget->showNormal(); mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex)); UBPlatformUtils::showFullScreen(mDisplayWidget); } diff --git a/src/desktop/UBCustomCaptureWindow.cpp b/src/desktop/UBCustomCaptureWindow.cpp index dc26abad..1a319738 100644 --- a/src/desktop/UBCustomCaptureWindow.cpp +++ b/src/desktop/UBCustomCaptureWindow.cpp @@ -79,6 +79,8 @@ int UBCustomCaptureWindow::execute(const QPixmap &pScreenPixmap) QDesktopWidget *desktop = QApplication::desktop(); int currentScreen = desktop->screenNumber(QCursor::pos()); + // necessary so that changing geometry really affects the widget + showNormal(); setGeometry(desktop->screenGeometry(currentScreen)); this->show(); setWindowOpacity(1.0); diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 138d0fb4..f63560e6 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -516,6 +516,7 @@ QPixmap UBDesktopAnnotationController::getScreenPixmap() QScreen * screen = UBApplication::controlScreen(); QRect rect = desktop->screenGeometry(QCursor::pos()); + rect.moveTo(0, 0); return screen->grabWindow(desktop->effectiveWinId(), rect.x(), rect.y(), rect.width(), rect.height()); @@ -556,7 +557,7 @@ void UBDesktopAnnotationController::penActionPressed() // Check if the mouse cursor is on the little arrow QPoint cursorPos = QCursor::pos(); - QPoint palettePos = mDesktopPalette->pos(); + QPoint palettePos = mDesktopPalette->mapToGlobal(QPoint(0, 0)); // global coordinates of palette QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionPen); int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette @@ -610,7 +611,7 @@ void UBDesktopAnnotationController::eraserActionPressed() // Check if the mouse cursor is on the little arrow QPoint cursorPos = QCursor::pos(); - QPoint palettePos = mDesktopPalette->pos(); + QPoint palettePos = mDesktopPalette->mapToGlobal(QPoint(0, 0)); QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionEraser); int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette @@ -665,7 +666,7 @@ void UBDesktopAnnotationController::markerActionPressed() // Check if the mouse cursor is on the little arrow QPoint cursorPos = QCursor::pos(); - QPoint palettePos = mDesktopPalette->pos(); + QPoint palettePos = mDesktopPalette->mapToGlobal(QPoint(0, 0)); QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionMarker); int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette @@ -967,7 +968,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) p.setPen(Qt::red); p.setBrush(QBrush(Qt::red)); - p.drawRect(mTransparentDrawingView->geometry().x(), mTransparentDrawingView->geometry().y(), mTransparentDrawingView->width(), mTransparentDrawingView->height()); + p.drawRect(0, 0, mTransparentDrawingView->width(), mTransparentDrawingView->height()); p.end(); mTransparentDrawingView->setMask(mMask.mask());