SUMMARY The DBus interface for ActivityInformation and ListActivitiesWithInformation (and possibly others) advertises results consisting of 3 strings and a double: https://invent.kde.org/plasma/kactivitymanagerd/-/blob/master/src/common/dbus/org.kde.ActivityManager.Activities.xml?ref_type=heads#L51 The actual C++ structure consists of 4 strings and an integer: https://invent.kde.org/plasma/kactivitymanagerd/-/blob/master/src/common/dbus/org.kde.ActivityManager.Activities.h?ref_type=heads#L13 This causes DBus bindings that depend on introspection (e.g. pydbus) to fail to decode method call results. STEPS TO REPRODUCE The following python script demonstrates the problem: #!/usr/bin/env python3 import pydbus bus = pydbus.SessionBus() activities = bus.get("org.kde.ActivityManager", "/ActivityManager/Activities") print(activities.ListActivitiesWithInformation()) 1. 2. 3. OBSERVED RESULT Traceback (most recent call last): File "/var/home/bkoropoff/tablet-activity-switcher", line 5, in <module> print(activities.ListActivitiesWithInformation()) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/usr/lib/python3.13/site-packages/pydbus/proxy_method.py", line 102, in __call__ raise error File "/usr/lib/python3.13/site-packages/pydbus/proxy_method.py", line 97, in __call__ result = instance._bus.con.call_sync(*call_args) gi.repository.GLib.GError: g-io-error-quark: Method “ListActivitiesWithInformation” returned type “(a(ssssi))”, but expected “(a(sssd))” (13) EXPECTED RESULT It works. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora Kinoite 42 KDE Plasma Version: 6.4.3 KDE Frameworks Version: 6.16.0 Qt Version: 6.9.1 ADDITIONAL INFORMATION These methods appear to have had incorrect introspection information since they were introduced (d was used instead of i in the signature): https://invent.kde.org/plasma/kactivitymanagerd/-/commit/4c6e1d3936e528a715df19d63b1e3a6fa1f2b808 An additional field was added later without updating the XML: https://invent.kde.org/plasma/kactivitymanagerd/-/commit/901638dbf870cb6e7eeac529c1d30c724c2faf39
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kactivitymanagerd/-/merge_requests/90
Git commit 81f71b15d51306c766d3a7f109e9d8b33ed545de by Ivan Čukić. Committed on 30/07/2025 at 12:46. Pushed by ivan into branch 'master'. Update org.kde.ActivityManager.Activities interface XML definition M +2 -2 src/common/dbus/org.kde.ActivityManager.Activities.xml https://invent.kde.org/plasma/kactivitymanagerd/-/commit/81f71b15d51306c766d3a7f109e9d8b33ed545de
Thanks!
No problem. If you're writing something that uses most of the DBus API, and you're willing to share it, we might be able to use it for auto tests to avoid XML definition breaks like this one. (otherwise, we'll have to whip up something when we find the time ;) )
I wrote a small service that subscribes to KWin tablet mode signals and changes my 2-in-1 laptop between a tablet and non-tablet activity. I can put it up on github, but it doesn't use all that many DBus methods, and I switched to a more modern Python DBus library that doesn't depend on introspection.
Sounds cool, though you are right that it is not going to help for this. I'll have to write python introspection tests then :)