src/eric7/Snapshot/SnapshotWaylandGrabber.py

branch
eric7
changeset 9624
b47dfa7a137d
parent 9482
a2bc06a54d9d
child 9653
e67609152c5e
--- a/src/eric7/Snapshot/SnapshotWaylandGrabber.py	Sun Dec 18 14:19:10 2022 +0100
+++ b/src/eric7/Snapshot/SnapshotWaylandGrabber.py	Sun Dec 18 19:33:46 2022 +0100
@@ -22,8 +22,8 @@
 except ImportError:
     DBusAvailable = False
 
-from eric7 import Globals
 from eric7.EricWidgets import EricMessageBox
+from eric7.SystemUtilities import DesktopUtilities
 
 from .SnapshotModes import SnapshotModes
 from .SnapshotTimer import SnapshotTimer
@@ -57,14 +57,14 @@
         @return tuple of supported screenshot modes
         @rtype tuple of SnapshotModes
         """
-        if DBusAvailable and Globals.isKdeDesktop():
+        if DBusAvailable and DesktopUtilities.isKdeDesktop():
             # __IGNORE_WARNING_Y114__
             return (
                 SnapshotModes.FULLSCREEN,
                 SnapshotModes.SELECTEDSCREEN,
                 SnapshotModes.SELECTEDWINDOW,
             )
-        elif DBusAvailable and Globals.isGnomeDesktop():
+        elif DBusAvailable and DesktopUtilities.isGnomeDesktop():
             return (
                 SnapshotModes.FULLSCREEN,
                 SnapshotModes.SELECTEDSCREEN,
@@ -130,7 +130,7 @@
         """
         snapshot = QPixmap()
 
-        if Globals.isKdeDesktop():
+        if DesktopUtilities.isKdeDesktop():
             interface = QDBusInterface(
                 "org.kde.KWin", "/Screenshot", "org.kde.kwin.Screenshot"
             )
@@ -141,7 +141,7 @@
                     snapshot = QPixmap(filename)
                     with contextlib.suppress(OSError):
                         os.remove(filename)
-        elif Globals.isGnomeDesktop():
+        elif DesktopUtilities.isGnomeDesktop():
             path = self.__temporaryFilename()
             interface = QDBusInterface(
                 "org.gnome.Shell",
@@ -164,7 +164,7 @@
         """
         snapshot = QPixmap()
 
-        if Globals.isKdeDesktop():
+        if DesktopUtilities.isKdeDesktop():
             screen = QApplication.screenAt(QCursor.pos())
             try:
                 screenId = QApplication.screens().index(screen)
@@ -183,7 +183,7 @@
                     snapshot = QPixmap(filename)
                     with contextlib.suppress(OSError):
                         os.remove(filename)
-        elif Globals.isGnomeDesktop():
+        elif DesktopUtilities.isGnomeDesktop():
             # Step 1: grab entire desktop
             path = self.__temporaryFilename()
             interface = QDBusInterface(
@@ -220,7 +220,7 @@
         """
         snapshot = QPixmap()
 
-        if Globals.isKdeDesktop():
+        if DesktopUtilities.isKdeDesktop():
             mask = 0
             if self.__captureDecorations:
                 mask |= 1
@@ -236,7 +236,7 @@
                     snapshot = QPixmap(filename)
                     with contextlib.suppress(OSError):
                         os.remove(filename)
-        elif Globals.isGnomeDesktop():
+        elif DesktopUtilities.isGnomeDesktop():
             path = self.__temporaryFilename()
             interface = QDBusInterface(
                 "org.gnome.Shell",
@@ -265,7 +265,7 @@
         """
         snapshot = QPixmap()
 
-        if Globals.isGnomeDesktop():
+        if DesktopUtilities.isGnomeDesktop():
             # Step 1: let the user select the area
             interface = QDBusInterface(
                 "org.gnome.Shell",

eric ide

mercurial