Open kyechou opened 1 year ago
Could you try this checklist and report the results? https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist
You need to install xdg-desktop-portal-gtk too.
Good day!
@smlx thanks for the suggestion! I've gone through the checklist a few times before, and I went through it again just now. Screen sharing through either webRTC (tested on firefox) or OBS works perfectly. But screenshot still doesn't work. All the systemd user units are active, running, and enabled as described in the checklist, and all the environment variables are set as they should.
$ < "/proc/$(pidof xdg-desktop-portal)/environ" tr '\0' '\n' | grep '^WAYLAND_DISPLAY='
WAYLAND_DISPLAY=wayland-1
$ < "/proc/$(pidof xdg-desktop-portal)/environ" tr '\0' '\n' | grep '^XDG_CURRENT_DESKTOP='
XDG_CURRENT_DESKTOP=sway
It may be worth mentioning that I'm testing the setup with solely Intel iGPU, so that hopefully eliminates all the Nvidia-related nonsense.
@IlyaMZP, thanks! I know it will work if xdg-desktop-portal-gtk, xdg-desktop-portal-kde, or other backends are installed, https://github.com/flameshot-org/flameshot/issues/2959#issuecomment-1316653050 also mentioned something similar, but I'm not sure why they are required. I'm not really familiar with the code. And if they are required, should they be a dependency of xdg-desktop-portal-wlr?
I'm not sure why they are required. I'm not really familiar with the code. And if they are required, should they be a dependency of xdg-desktop-portal-wlr?
I'm not sure either, but that is what finally made it work for me. You need a way to give an application the permission to take a screenshot, and that permission prompt is part of xdg-desktop-portal-gtk. Maybe there is a way to make it work without xdg-desktop-portal-gtk, but I haven't been able to find one.
I'm not sure either, but that is what finally made it work for me. You need a way to give an application the permission to take a screenshot, and that permission prompt is part of xdg-desktop-portal-gtk. Maybe there is a way to make it work without xdg-desktop-portal-gtk, but I haven't been able to find one.
So with the updated interface that can request permission, because xdg-desktop-portal-wlr doesn't have a way to ask permission, xdg-desktop-portal instead (possibly) delegates that to the other backends? I see this in the 1.15.0 release notes for xdg-desktop-portal:
Frontends that implement the version 2 of org.freedesktop.portal.impl.Screenshot portal can now be aware that the screenshot permission was granted through the new 'permission_store_checked' option, and skip any kind of dialog when that is the case.
I am unable to locate where such an option is set in any of the portal backends, though, but from what I can observe, it could be relevant to this issue (using solely xdg-desktop-portal-wlr).
With xdg-dektop-portal-gtk installed, I still have issues. I could have screenshoot once only, and then I get this in my logs:
Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
Apparently, it fails to detect the correct interface to ask for permissions.
I tried restarting xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-gtk
Apparently, it does not detect the installed gtk portal
Investigating again and I find back my comment :)
I could make flameshot gui
work 9but only once) by manually running xdg-desktop-portal-wlr: /usr/libexec/xdg-desktop-portal-wlr -r -l TRACE
. Going through the checklist, all seems ok.
I confirm that upgrading xdg-desktop-portal-wlr
from 0.6.0
to 0.7.0
did not solve this issue as it was previously anticipated. However, downgrading xdg-desktop-portal
to 1.14.6
works well with xdg-desktop-portal-wlr 0.7.0
.
I had the same problem, but after I also installed xdg-desktop-portal-gtk
, and then restarting xdg-desktop-portal
, flameshot gui
started to work. I wasn't able to downgrade xdg-desktop-portal
, as such old versions weren't available anymore in my package manager, but installing the gtk portal in addition to the wlr portal also worked, so maybe that also helps somebody else.
Installing xdg-desktop-portal-gtk does solve the issue but it makes my wonder why? Since either way we specify wlr in sway-portals.conf as in: org.freedesktop.impl.portal.Screenshot=wlr what does GTK have to do with any of it? I investigated a bit and without gtk, the Screenshot portal doesn't get "turned on/used" based on input from xdg-desktop-portal --replace --verbose
. I figured it's the org.freedesktop.impl.portal.Access that gtk provides that makes Screenshotting work. However, ScreenCasting without that portal works fine so I'm wondering why is that the case? Maybe we could say in the readme that gtk is indeed needed for Screenshotting to work instead of only saying that we can set a fallback portal?
DBus says "No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop" while taking screenshots through xdg-desktop-portal-wlr.
My setup
More description
Essentially it's the same issue as https://github.com/flatpak/xdg-desktop-portal/issues/861 (the exact same situation and output), where it's mentioned that c83b3cc51411237aa2071de5303ae5719d926032 should fix the problem, but it seems the issue still exists, both in sway and Hyprland. The same issue also occurred in Wayfire, according to https://github.com/flameshot-org/flameshot/issues/2959#issuecomment-1316653050.
Steps to reproduce
flameshot gui
or the test script.Related issues: