eric6/Snapshot/SnapshotFreehandGrabber.py

changeset 7957
7bdfa13bc3f5
parent 7945
76daafe10009
child 7966
3afa7b9e51b0
diff -r 7db67b70e6a8 -r 7bdfa13bc3f5 eric6/Snapshot/SnapshotFreehandGrabber.py
--- a/eric6/Snapshot/SnapshotFreehandGrabber.py	Mon Jan 04 16:52:56 2021 +0100
+++ b/eric6/Snapshot/SnapshotFreehandGrabber.py	Mon Jan 04 19:34:49 2021 +0100
@@ -10,9 +10,9 @@
 from PyQt5.QtCore import pyqtSignal, Qt, QRect, QPoint, QTimer, QLocale
 from PyQt5.QtGui import (
     QPixmap, QColor, QRegion, QPainter, QPalette, QPolygon, QPen, QBrush,
-    QPaintEngine
+    QPaintEngine, QGuiApplication, QCursor
 )
-from PyQt5.QtWidgets import QWidget, QApplication, QToolTip
+from PyQt5.QtWidgets import QWidget, QToolTip
 
 
 def drawPolygon(painter, polygon, outline, fill=None):
@@ -82,9 +82,14 @@
         """
         Private slot to initialize the rest of the widget.
         """
-        self.__pixmap = QApplication.screens()[0].grabWindow(0)
+        screen = QGuiApplication.screens()[0]
+        self.__virtualGeometrie = screen.availableVirtualGeometry()
+        screen = QGuiApplication.screenAt(QCursor.pos())
+        sgeom = screen.geometry()
+        self.__pixmap = screen.grabWindow(
+            0, sgeom.x(), sgeom.y(), sgeom.width(), sgeom.height())
         self.resize(self.__pixmap.size())
-        self.move(0, 0)
+        self.move(sgeom.x(), sgeom.y())
         self.setCursor(Qt.CrossCursor)
         self.show()
 

eric ide

mercurial