Summary: | No reply to Quit() after Inhibit() call | ||
---|---|---|---|
Product: | [Plasma] xdg-desktop-portal-kde | Reporter: | Carlo <cirlo_ca> |
Component: | general | Assignee: | Jan Grulich <jgrulich> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jgrulich, joseph, nate |
Priority: | NOR | Keywords: | efficiency-and-performance |
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Manjaro | ||
OS: | Linux | ||
Latest Commit: | 8e21923f57f3c216885dfb80ef8aeaafe415a24e | Version Fixed In: | 5.23 |
Sentry Crash Report: |
Description
Carlo
2021-05-01 14:07:31 UTC
It is implemented here [1] and it's been used by my test app here [2]. I just tested it and it works just fine. [1] - https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/master/src/request.cpp [2] - https://invent.kde.org/libraries/xdg-portal-test-kde/-/blob/master/src/portaltest.cpp#L342 I tried your portal-test as host application and it works for me as well. At this point I don't know what to change in my demo.. I am fairly new to dbus and I cannot explain to myself why it works on GNOME, but it does not on KDE. Would you please be so kind to try helping me debugging it? I am using python dbus API + Gtk because I'd like to then write a merge request for a Gtk app written in python P.S. I also tried to make an asynchronous call to Close(), but it didn't help. It just changed the error it displayed to GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/org/freedesktop/portal/desktop/request/1_204/t' where 1_204/t is the handle returned by Inhibit actually: i think the UnknownObject error is due to the fact that i tried to click the toggle multiple times trying to close the request. The first time still gets org.freedesktop.DBus.Error.NoReply, so there is really no change with asynch calls I tried your app, but it doesn't even inhibit the session. Clicking on the button doesn't do anything for me. On KDE? That's strange, powerdevil seems to detect it on my system: https://i.imgur.com/eEJUAVh.png I assume the systems has installed: Gtk4, dbus-python and python-gobject I'm on Wayland, that will be the reason why it doesn't work. with GDK_BACKEND=X11 I get: Traceback (most recent call last): File "/home/jgrulich/foo.py", line 59, in <lambda> self.connect('activate', lambda app: app.on_activate()) File "/home/jgrulich/foo.py", line 75, in on_activate self.win = Gtk.Window(application=self, title="A window") File "/usr/lib/python3.9/site-packages/gi/overrides/Gtk.py", line 519, in __init__ raise RuntimeError( RuntimeError: Gtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case. Could the X11 error due to the fact that the DISPLAY variable is not set? On Wayland you may want to try this version of the demo, where I don't try to get toplevel's handle to pass to the Portal: https://pastebin.com/raw/tziTenUa It does release inhibition when I close the app. method call time=1620039298.850438 sender=:1.42 -> destination=:1.56 serial=1330 path=/org/freedesktop/portal/desktop/request/1_384/t; interface=org.freedesktop.impl.portal.Request; member=Close method call time=1620039298.850706 sender=:1.56 -> destination=org.kde.Solid.PowerManagement serial=1506 path=/org/kde/Solid/PowerManagement/PolicyAgent; interface=org.kde.Solid.PowerManagement.PolicyAgent; member=ReleaseInhibition uint32 323 Yes, I noticed that! But I think it's the Portal that un-inhibits the session when it detects the peer has exited. But I don't make the Close() call on exit Oh I just realised that in my demo it is not clear that if you click a second time on "Toggle Inhibtion", it uninhibits the session. That is what caused me problems. Fixed with https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/8e21923f57f3c216885dfb80ef8aeaafe415a24e. Confirming the fix works for me as well! Many thanks ^^ |