Tue, 10 Apr 2012 18:50:43 +0200
Implemented a fix for dual screen config on Windows.
--- a/Snapshot/SnapWidget.py Mon Apr 09 18:51:29 2012 +0200 +++ b/Snapshot/SnapWidget.py Tue Apr 10 18:50:43 2012 +0200 @@ -345,7 +345,9 @@ self.__grabTimer.stop() if self.__mode == SnapWidget.ModeFullscreen: - self.__snapshot = QPixmap.grabWindow(QApplication.desktop().winId()) + desktop = QApplication.desktop() + self.__snapshot = QPixmap.grabWindow(desktop.winId(), + desktop.x(), desktop.y(), desktop.width(), desktop.height()) elif self.__mode == SnapWidget.ModeScreen: desktop = QApplication.desktop() screenId = desktop.screenNumber(QCursor.pos())
--- a/Snapshot/SnapshotFreehandGrabber.py Mon Apr 09 18:51:29 2012 +0200 +++ b/Snapshot/SnapshotFreehandGrabber.py Tue Apr 10 18:50:43 2012 +0200 @@ -77,9 +77,13 @@ """ Private slot to initialize the rest of the widget. """ - self.__pixmap = QPixmap.grabWindow(QApplication.desktop().winId()) + self.__desktop = QApplication.desktop() + x = self.__desktop.x() + y = self.__desktop.y() + self.__pixmap = QPixmap.grabWindow(self.__desktop.winId(), x, y, + self.__desktop.width(), self.__desktop.height()) self.resize(self.__pixmap.size()) - self.move(0, 0) + self.move(x, y) self.setCursor(Qt.CrossCursor) self.show() @@ -129,7 +133,8 @@ painter.setPen(textColor) painter.setBrush(textBackgroundColor) self.__helpTextRect = painter.boundingRect(self.rect().adjusted(2, 2, -2, -2), - Qt.TextWordWrap, self.__helpText) + Qt.TextWordWrap, self.__helpText).translated( + -self.__desktop.x(), -self.__desktop.y()) self.__helpTextRect.adjust(-2, -2, 4, 2) drawPolygon(painter, self.__helpTextRect, textColor, textBackgroundColor) painter.drawText(self.__helpTextRect.adjusted(3, 3, -3, -3),
--- a/Snapshot/SnapshotRegionGrabber.py Mon Apr 09 18:51:29 2012 +0200 +++ b/Snapshot/SnapshotRegionGrabber.py Tue Apr 10 18:50:43 2012 +0200 @@ -105,9 +105,13 @@ """ Private slot to initialize the rest of the widget. """ - self.__pixmap = QPixmap.grabWindow(QApplication.desktop().winId()) + self.__desktop = QApplication.desktop() + x = self.__desktop.x() + y = self.__desktop.y() + self.__pixmap = QPixmap.grabWindow(self.__desktop.winId(), x, y, + self.__desktop.width(), self.__desktop.height()) self.resize(self.__pixmap.size()) - self.move(0, 0) + self.move(x, y) self.setCursor(Qt.CrossCursor) self.show() @@ -154,7 +158,8 @@ painter.setPen(textColor) painter.setBrush(textBackgroundColor) self.__helpTextRect = painter.boundingRect(self.rect().adjusted(2, 2, -2, -2), - Qt.TextWordWrap, self.__helpText) + Qt.TextWordWrap, self.__helpText).translated( + -self.__desktop.x(), -self.__desktop.y()) self.__helpTextRect.adjust(-2, -2, 4, 2) drawRect(painter, self.__helpTextRect, textColor, textBackgroundColor) painter.drawText(self.__helpTextRect.adjusted(3, 3, -3, -3),