-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
DBus Codegen #9810
DBus Codegen #9810
Conversation
You can test this PR using the following package version. |
Are you using some codegen tool to generate implementations? If so, it would be way better to have it as a Roslyn Generator. |
I'm currently working on a proper roslyn code generator for this purpose, but a first proof-of-concept I used the Tmds.DBus.Tool dotnet tool. |
src/Avalonia.FreeDesktop/DBusIme/IBus/IBusX11TextInputMethod.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # src/Avalonia.FreeDesktop/DBusMenu.cs
# Conflicts: # src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxX11TextInputMethod.cs # src/Avalonia.FreeDesktop/DBusMenuExporter.cs # src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs
You can test this PR using the following package version. |
# Conflicts: # src/Avalonia.FreeDesktop/DBusMenuExporter.cs
You can test this PR using the following package version. |
You can test this PR using the following package version. |
Note: Tray-Icon submenus don't work, needs investigation
You can test this PR using the following package version. |
You can test this PR using the following package version. |
// Connect synchronously | ||
conn.ConnectAsync().Wait(); | ||
conn.ConnectAsync().GetAwaiter().GetResult(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make TryInitialize async perhaps? To avoid this code smell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd either require the usage of an async void method (which, at least in my opinion, isn't any better), or making the complete initialization process async as well. While I'd like to see the latter at some point since nearly everything is async today anyway, it's probably out of scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh cool cool, the latter is a good thing to do afterwards 👍
# Conflicts: # src/Avalonia.X11/X11Window.cs
- Uses Reflection underneath - It's faster to just fail than receiving all available services first
@kekekeks are we good to merge it with submodules, or should we wait until it's available on the nuget? |
We need to somehow |
Tmds.DBus.Protocol is probably going to be published on NuGet "earyl next week", see tmds/Tmds.DBus#79 (comment). |
@affederaffe in general I think it's enough to create a key and sign from the Visual Studio project properties page. Not sure what's advantage of adding PublicSign property though. |
# Conflicts: # Avalonia.Desktop.slnf # src/Avalonia.FreeDesktop/DBusSystemDialog.cs # src/Avalonia.FreeDesktop/IX11InputMethod.cs
I don't quite understand why and how render tests are failing on this PR for all platforms. |
You can test this PR using the following package version. |
After this PR dbus callbacks are executed on some random thread instead of dispatcher one |
What does the pull request do?
Use Tmds.DBus.Protocol directly instead of relying on the System.Reflection.Emit backend.
This will greatly help with trimming and in aot-scenarios.
Note that it's currently using a submodule (hence WIP) since a) Tmds.DBus.Protocol isn't released on NuGet yet and b) sending large buffers is currently broken (e.g. sending tray icon images)
What is the current behavior?
Usage of the S.R.E backend, which breaks when using trimming/aot.
What is the updated/expected behavior with this PR?
Trimming/Aot should work.
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
None(?)
Obsoletions / Deprecations
None
Fixed issues
#2359
#10069