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

Error getting permissions: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for inhibit #272

Closed
mcatanzaro opened this issue Dec 8, 2018 · 5 comments

Comments

@mcatanzaro
Copy link
Contributor

mcatanzaro commented Dec 8, 2018

I've been trying to debug why my computer is turning off the display when watching YouTube video longer than 5m. Turns out there's an unrelated bug in WebKit causing it to not attempt to use the inhibit portal at all. Anyway, with my WebKit modified to avoid that, and hacked up a bit to try using the portal even when running outside flatpak, then when running /usr/libexec/xdg-desktop-portal --verbose, I see:

(/usr/libexec/xdg-desktop-portal:61123): WARNING **: 15:27:37.829: Error getting permissions: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for inhibit

That occurs at the top of get_allowed_inhibit in inhibit.c. Not sure how this permission store is supposed to work, but seems like it's broken?

Note: I'm running WebKit outside flatpak, just for testing purposes.

@matthiasclasen
Copy link
Contributor

matthiasclasen commented Dec 8, 2018

The permission warnig is a red herring - by default, the portal allows all inhibiting, and nothing ever creates permissions to change that. We should not warn there.

As far as I can determine with my portal test app, it calls the Inhibit portal, the Inhibit portal calls its backend, the backend calls org.gnome.SessionManager.Inhibit, the inhibitor shows up in d-feet, and gnome-shell sees it and pops up the dialog when I try to log out.

So,as far as portals are concerned, everything is a-ok.

If you are using the portal directly, I'm a bit stumped for what could go wrong. If you are using gtk_application_inhibit, that one only tries to talk to the portal when it can't find org.gnome.SessionManager on the bus.

@mcatanzaro
Copy link
Contributor Author

It uses the portal directly: https://github.com/WebKit/webkit/blob/89c28d471fae35f1788a0f857067896a10af8974/Source/WebCore/PAL/pal/system/glib/SleepDisablerGLib.cpp#L74-L96

Note I've locally disabled all the code that tries using org.freedesktop.ScreenSaver to ensure it only tries using the portal.

@mcatanzaro mcatanzaro changed the title Inhibit portal seems to be broken Error getting permissions: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for inhibit Dec 9, 2018
@mcatanzaro
Copy link
Contributor Author

Yeah it looks like the portal is working properly. I got tricked by a WebKit bug, and that bogus warning. So let's repurpose this bug for the warning, then?

matthiasclasen pushed a commit to matthiasclasen/xdg-desktop-portal that referenced this issue Dec 9, 2018
The permissions are expected to be empty - we allow all
inhibiting by default. We should not warn in this case,
reduce this to debug spew, and add some more in other
places.

Closes: flatpak#272
@matthiasclasen
Copy link
Contributor

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants