eneoli / flakeshot

A screenshot tool for unix-systems which runs natively on Wayland and X11!
GNU General Public License v2.0
20 stars 1 forks source link

X11: `backend::create_screenshots` creates blank screenshots #91

Open eneoli opened 8 months ago

eneoli commented 8 months ago

System also has Hyprland installed.

Steps to reproduce:

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.

eneoli commented 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.

eneoli commented 8 months ago

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:

``
eneoli commented 8 months ago

We are back on0.7.0for now... wrong PR

TornaxO7 commented 8 months ago

peepoYes

TornaxO7 commented 7 months ago

Waiting for... https://github.com/iovxw/ksni/pull/23