Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X11: backend::create_screenshots creates blank screenshots #91

Open
eneoli opened this issue Feb 3, 2024 · 5 comments · May be fixed by #142
Open

X11: backend::create_screenshots creates blank screenshots #91

eneoli opened this issue Feb 3, 2024 · 5 comments · May be fixed by #142
Assignees
Labels
bug Something isn't working X11 Related to X11

Comments

@eneoli
Copy link
Owner

eneoli commented Feb 3, 2024

System also has Hyprland installed.

Steps to reproduce:

  • install xorg, xorg-server and xorg-xinit
  • install gnome or plasma desktop environment
  • Run flakeshot under x11 env.

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
Copy link
Owner Author

eneoli commented Feb 4, 2024

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
Copy link
Owner Author

eneoli commented Feb 5, 2024

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:

``

@TornaxO7 TornaxO7 added bug Something isn't working X11 Related to X11 labels Feb 7, 2024
@eneoli
Copy link
Owner Author

eneoli commented Feb 8, 2024

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

@TornaxO7
Copy link
Collaborator

TornaxO7 commented Feb 8, 2024

peepoYes

@TornaxO7
Copy link
Collaborator

Waiting for... iovxw/ksni#23

@TornaxO7 TornaxO7 linked a pull request Apr 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working X11 Related to X11
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants