Avalonia
Avalonia copied to clipboard
[DBUS] Don't break when reading settings from org.freedesktop.portalSettings v1
https://github.com/AvaloniaUI/Avalonia/pull/15568 made an attempt to correctly handle int32-in-variant-in-another-variant value ([Variant: [Variant(uint): 2]]
in qdbus notation), however the current version of Tmds.DBus.Protocol simply reads it as a single VariantValue with int32 type (https://github.com/tmds/Tmds.DBus/issues/282).
The PR removes GetItem call that wasn't intended to be used for unwrapping variants and adds a type check later just in case.
Verified with Plasma 5.27. @affederaffe
You can test this PR using the following package version. 11.2.999-cibuild0048189-alpha
. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
Shouldn't this be fixed in Tmds.DBus.Protocol then? Per spec we expect the Variant to not be collapsed, so in my opinion this is the wrong layer to fix it. In the meantime, we can easily revert the initial PR, the old Tmds.DBus.SourceGenerator Variant system has proven to work as expected.
Closing this PR, as dbus upgrade was reverted.