Wed, 03 Apr 2019 19:13:02 +0200
Snapshot: fixed some issues and implemented support for the two include options (decorations, mouse cursor) on Wayland.
--- a/Snapshot/SnapWidget.py Tue Apr 02 19:52:36 2019 +0200 +++ b/Snapshot/SnapWidget.py Wed Apr 03 19:13:02 2019 +0200 @@ -51,8 +51,8 @@ self.setWindowIcon(UI.PixmapCache.getIcon("ericSnap.png")) # TODO: correct this once tested -# if Globals.isWaylandSession(): - if True: + if Globals.isWaylandSession(): +# if True: from .SnapshotWaylandGrabber import SnapshotWaylandGrabber self.__grabber = SnapshotWaylandGrabber(self) else: @@ -310,10 +310,12 @@ self.__savedPosition = self.pos() self.hide() - # TODO: add support for decorations and mouse cursor self.__grabber.grab( self.modeCombo.itemData(self.modeCombo.currentIndex()), - self.delaySpin.value()) + self.delaySpin.value(), + self.mouseCursorCheckBox.isChecked(), + self.decorationsCheckBox.isChecked(), + ) def __redisplay(self): """ @@ -412,9 +414,11 @@ Preferences.Prefs.settings.setValue( "Snapshot/Delay", self.delaySpin.value()) - Preferences.Prefs.settings.setValue( - "Snapshot/Mode", - self.modeCombo.itemData(self.modeCombo.currentIndex()).value) + modeData = self.modeCombo.itemData(self.modeCombo.currentIndex()) + if modeData is not None: + Preferences.Prefs.settings.setValue( + "Snapshot/Mode", + modeData.value) Preferences.Prefs.settings.setValue( "Snapshot/Filename", self.__filename) Preferences.Prefs.settings.sync()
--- a/Snapshot/SnapshotDefaultGrabber.py Tue Apr 02 19:52:36 2019 +0200 +++ b/Snapshot/SnapshotDefaultGrabber.py Wed Apr 03 19:13:02 2019 +0200 @@ -59,7 +59,8 @@ SnapshotModes.Ellipse, ) - def grab(self, mode, delay=0): + def grab(self, mode, delay=0, captureCursor=False, + captureDecorations=False): """ Public method to perform a grab operation potentially after a delay. @@ -67,6 +68,12 @@ @type ScreenshotModes @param delay delay in seconds @type int + @param captureCursor flag indicating to include the mouse cursor + (not used) + @type bool + @param captureDecorations flag indicating to include the window + decorations (not used) + @type bool """ self.__mode = mode if delay:
--- a/Snapshot/SnapshotWaylandGrabber.py Tue Apr 02 19:52:36 2019 +0200 +++ b/Snapshot/SnapshotWaylandGrabber.py Wed Apr 03 19:13:02 2019 +0200 @@ -88,6 +88,7 @@ @type bool @param captureDecorations flag indicating to include the window decorations (only used for mode SnapshotModes.SelectedWindow) + @type bool """ if not DBusAvailable: # just to play it safe