eric6/Snapshot/SnapshotWaylandGrabber.py

changeset 7945
76daafe10009
parent 7923
91e843545d9a
child 7957
7bdfa13bc3f5
--- a/eric6/Snapshot/SnapshotWaylandGrabber.py	Sat Jan 02 17:28:57 2021 +0100
+++ b/eric6/Snapshot/SnapshotWaylandGrabber.py	Sun Jan 03 15:33:39 2021 +0100
@@ -175,17 +175,12 @@
         snapshot = QPixmap()
         
         if Globals.isKdeDesktop():
-            # Step 1: get the screen number of screen containing the cursor
-            if Globals.qVersionTuple() >= (5, 10, 0):
-                screen = QApplication.screenAt(QCursor.pos())
-                try:
-                    screenId = QApplication.screens().index(screen)
-                except ValueError:
-                    # default to screen 0
-                    screenId = 0
-            else:
-                desktop = QApplication.desktop()
-                screenId = desktop.screenNumber(QCursor.pos())
+            screen = QApplication.screenAt(QCursor.pos())
+            try:
+                screenId = QApplication.screens().index(screen)
+            except ValueError:
+                # default to screen 0
+                screenId = 0
             
             # Step 2: grab the screen
             interface = QDBusInterface(
@@ -235,13 +230,8 @@
                     # Step 2: extract the area of the screen containing
                     #         the cursor
                     if not snapshot.isNull():
-                        if Globals.qVersionTuple() >= (5, 10, 0):
-                            screen = QApplication.screenAt(QCursor.pos())
-                            geom = screen.geometry()
-                        else:
-                            desktop = QApplication.desktop()
-                            screenId = desktop.screenNumber(QCursor.pos())
-                            geom = desktop.screenGeometry(screenId)
+                        screen = QApplication.screenAt(QCursor.pos())
+                        geom = screen.geometry()
                         snapshot = snapshot.copy(geom)
         
         self.grabbed.emit(snapshot)

eric ide

mercurial