flathub/org.gimp.GIMP

File->Create->From Screenshot not working

Closed this issue · 3 comments

Jehan commented

See: https://gitlab.gnome.org/GNOME/gimp/-/issues/6106

We need to add --talk-name=org.gnome.Shell.Screenshot.
We also need to add the talk name for KDE, but I'm not sure if it is supposed to be org.kde.KWin (the "bus name") or org.kde.kwin.Screenshot (the D-Bus interface name). Not sure what "talk-name" is supposed to be (for GNOME API, it was easier, the same name was used for both).

Maybe someone under KDE could test please?

  • First test the package as is, and confirm that File->Create->From Screenshot doesn't work (apparently it returns a black image).
  • Then run:

flatpak override org.gimp.GIMP --talk-name=org.kde.kwin.Screenshot

  • Test again if "From Screenshot" now creates a proper image from the screenshot.
  • If still not yet, run:

flatpak override org.gimp.GIMP --talk-name=org.kde.KWin

  • Test again.

Give us the result so that we can update the package.
Thanks!

First test the package as is, and confirm that File->Create->From Screenshot doesn't work (apparently it returns a black image).

Apparently, it's not that simple. I'm on Kubuntu 20.04 LTS on X11 with nVidia binary drivers and KWin 5.18.5 and:

  • The 2.10.24 on Flathub falls back to the ugly theme (I'm assuming because there's no GTK+ 2.x counterpart to org.gtk.Gtk3theme.Breeze?) but takes screenshots just fine, with a workflow for the "select a region" option that's so identical to what I'm used to without Flatpak that I'm wondering if it's using the direct-to-X11 codepath. (Is the black screenshot an artifact of running it under XWayland and getting dummy data via the old screenshotting codepath, maybe?)
  • The 2.10.18 from APT picks up the system GTK+ 2.x Breeze theme but errors with "No such object path '/Screenshot'" when I try to take screenshots.
  • QDBusViewer doesn't show org.kde.kwin.Screenshot as existing and I don't see anything relating to screenshotting inside org.kde.KWin... though org.freedesktop.impl.portal.Screenshot.Screenshot does appear to exist under /org/freedesktop/portal/desktop in both org.freedesktop.impl.portal.desktop.kde and org.freedesktop.portal.Desktop, so it'd make sense for it to be implemented. (They have type signatures that I don't know how to satisfy using qdbusviewer or qdbus and it's too close to bedtime for me to hack up a fancier test right now.)

I use snap, gimp version 2.10.24 revision 367
I've the same bug.
On wayland of course.

Jehan commented

Ok not waiting forever for feedbacks which never come, I just pushed what I think must be the right "talk-name" on both the master and beta branches as I'm updating a bunch of things. If that was not the right permissions, please anyone, feel free to reopen or open a new report with more information.

Anyway this is soon going to be useless apparently as we are supposed to move to the Freedesktop API, which is why it's maybe not worth spending too much time on it.

commit 4fa3fa7689bb56ebbea749d87f375ff4d9cbf3f7 (HEAD -> master, origin/master, origin/HEAD)
Author: Jehan <jehan@girinstud.io>
Date:   Tue Dec 14 20:20:02 2021 +0100

    Issue #106:  File->Create->From Screenshot not working.
    
    Adding dbus permission for screenshot APIs. I'm actually unsure about
    the KDE one, but nobody ever answered my request for test. So I'm going
    with what looks more likely (the accurate interface name rather than
    some too generic bus name).
    If that was not it, people are welcome to report the issue and we can
    fix. For the time being, let's not report forever.
    
    Also we might not even need these anymore in a close future, as we are
    likely to move towards the generic Freedesktop API instead (already did
    for GNOME on next releases). But at least it's fixed for current
    release.
    
    See also: https://gitlab.gnome.org/GNOME/gimp/-/issues/6106
    
    (cherry picked from commit 9c831b14ff605b2b41d9529e3a6dcb024725b35b)

 org.gimp.GIMP.json | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)