[Proof of Concept/WIP] Tmds to Avalonia.DBus migration#20799
Draft
[Proof of Concept/WIP] Tmds to Avalonia.DBus migration#20799
Conversation
Create DBusXml/Types.xml defining named structs (MenuLayout, MenuItemProperties, MenuEvent, IconPixmap, ToolTip, InputContextArg, FormattedPreeditSegment) and register it as an AdditionalFiles entry in the csproj so the source generator uses readable type names.
Add xmlns:av namespace, av:ImportTypes, and av:TypeDefinition annotations so the source generator produces named struct types instead of tuples: - com.canonical.dbusmenu.xml: MenuLayout, MenuItemProperties, MenuEvent - org.kde.StatusNotifierItem.xml: IconPixmap, ToolTip - org.fcitx.Fcitx.InputMethod1.xml: InputContextArg - org.fcitx.Fcitx.InputContext.xml: FormattedPreeditSegment - org.fcitx.Fcitx.InputContext1.xml: FormattedPreeditSegment
Replace auto-generated DbusStruct_* names with meaningful type names from the av:TypeDefinition annotations added to the DBus XML files: - DbusStruct_Riaesvavz -> MenuLayout - DbusStruct_Riaesvz -> MenuItemProperties - DbusStruct_Risvuz -> MenuEvent - DbusStruct_Riiayz -> IconPixmap - DbusStruct_Rsariiayzssz -> ToolTip - DbusStruct_Rssz -> InputContextArg - DbusStruct_Rsiz -> FormattedPreeditSegment Also update property accessors (.Item1/.Item2 -> named properties) in DBusMenuExporter.cs and FcitxX11TextInputMethod.cs.
Replace Tmds.DBus.Protocol/SourceGenerator with Avalonia.DBus across all FreeDesktop platform code: DBusHelper, system dialogs, platform settings, and IME implementations (IBus, Fcitx). Key changes: - Connection → DBusConnection - VariantValue → DBusVariant - ObjectPath → DBusObjectPath - Callback signatures simplified (removed Exception? first param) - Struct/Array helpers → DBusStruct/List<T>
|
You can test this PR using the following package version. |
Member
Author
|
Leaving this PR for future review/hold as trayicons/menus/dialogs seems to work |
|
You can test this PR using the following package version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switching our dbus backend for Avalonia.FreeDesktop from Tmds to Avalonia.DBus.
Proof of concept for now to see if this is a viable migration path.