Open eneoli opened 8 months ago
Function did screenshot the whole virtual screen and set them as individual screenshots of the screens. Partially fixed in #88 but screenshots still blank.
Problem exists on KDE and Gnome only. We will use a workaround via FreeDesktopPortal Screenshot capability.
See this python code for a reference implementation
import sys
import json
from PyQt5.QtCore import QObject, pyqtSlot
from PyQt5.QtWidgets import QApplication
from PyQt5.QtDBus import QDBusConnection, QDBusInterface, QDBusMessage
class DbusTest(QObject):
def __init__(self):
super(DbusTest, self).__init__()
bus = QDBusConnection.sessionBus()
bus.registerObject('/', self)
interface = QDBusInterface(
"org.freedesktop.portal.Desktop",
"/org/freedesktop/portal/desktop",
"org.freedesktop.portal.Screenshot",
)
reply = interface.call("Screenshot", "", {"interactive": False, "handle_token": "demo_app"})
path = (reply.arguments()[0])
print(path)
bus.connect(
'org.freedesktop.portal.Desktop',
path,
'org.freedesktop.portal.Request',
'Response',
self.testMessage
)
print('Connected')
@pyqtSlot(QDBusMessage)
def testMessage(self, msg):
print(json.dumps(msg.arguments()[1]))
print(msg.arguments()[1]['uri'])
if __name__ == '__main__':
app = QApplication(sys.argv)
discoverer = DbusTest()
sys.exit(app.exec_())
tation:
``
We are back on wrong PR 0.7.0
for now...
Waiting for... https://github.com/iovxw/ksni/pull/23
System also has Hyprland installed.
Steps to reproduce:
xorg
,xorg-server
andxorg-xinit
Related to #88 crop selection bug: canvas not getting cleaned properly because of the screenshots being transparent.
Other screenshot tools are able to do screenshots seamlessly.