-
-
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
[WIP] Add Wayland backend #11546
[WIP] Add Wayland backend #11546
Conversation
Thank you so much for your work! I hope this gets merged into 11! |
@affederaffe Do you think this can be still merged for the 11 update? |
There are still some minor bugs to be fixed before merging and since Avalonia 11 seems to be moving closer and closer to RCs (feature freeze), I don't think we'll see this merged before 11.0. 11.x seems to be possible though, see the prior discussion |
# Conflicts: # src/Avalonia.DesignerSupport/Remote/Stubs.cs # src/Headless/Avalonia.Headless/HeadlessWindowImpl.cs
11.1. 11.0 rc is coming in a matter of days and the team wont have time to test or review this in that time. 11.1 is likely to be very very soon after 11.0 however. |
There's still some work to do:
|
|
is this dead? |
The plan is to figure something about CSD support in core avalonia and continue. Alternatively we could release it without CSD for usage with embedded systems, wayland seems to be ready enough for those. |
There are just too many unresolved issues, until I have the time and motivation to address those this PR continues to be WIP and thus unmergable from my perspective. |
My understanding is that only GNOME requires CSD, and most other DEs are happy with SSD. If that's true, then it might make more sense to just default back to X11 for GNOME, and use Wayland on everything else? |
Even though I disagree with GNOME's philosophy to not support SSDs, they are still a major platform we cannot ignore. At least for me, it's full wayland support that works on every platform or none at all. |
My 2 cents on this topic: as an embedded developer I'm testing Avalonia and I noticed a trend: the latest implementations of Yocto/EmbeddedLinux (one of all for example NXP i.MX8) lack X11 implementation on graphics drivers by specific choice of the OEM. Therefore, at present, DRM is the only way to achieve hardware acceleration, with all the limitations of it (cursor and keyboard for example). In my opinion in the short/medium term Avalonia must have compatibility on Wayland to be 100% competitive on Linux, especially on the industrial/embedded side. |
Once again, we should thanks the GNOME developers for sabotaging the Linux desktop. |
@affederaffe is there any alternative for NWayland in NuGet that work with your PR ? |
wayland support on KDE, wlroots and hyprland would improve support for those environments while not degrading GNOME's. I for one would highly apprechiate being able to run Avalonia-based programs with proper scaling. Additionally, I predict that GNOME will allow server-side decorations if enough programs exclude them from wayland support because of that. |
GNOME is pretty stubborn with their design philosophy. If anything, you could still rig crude decorations through libdecor until proper decorations are added. |
nope this will not work with gnome developers |
If we wait for GNOME to implement SSD to release this PR we will all become centenarians. A fallback method could be added in the AppBuilder that is invoked when the server does not implement SSD. Each developer will implement their own fallback based on their needs |
the only way to wayland to improve is by everyone adopting it and start report issues and complain about missing features and demanding alternative |
Do you have any plans to support libdecor for handling SSD-less compositors, like Mutter from GNOME? Using XWayland in a Wayland environment has some drawbacks : Performance Overhead: Adds extra processing, leading to potential performance drops. |
And drag and drop does not work with with Wayland apps! |
When running X11 applications on Wayland via XWayland, drag-and-drop may not work as expected due to the compatibility layer's limitations. This is because XWayland translates between X11 and Wayland, and some operations (like drag-and-drop) might not translate perfectly. and even in native wayland app its sill not wayland fault, sometime its app fault : Many applications were originally developed for X11, and not all of them have been fully adapted to work with Wayland. This can lead to missing or broken functionality, including drag-and-drop plus : The Wayland protocol provides clients a mechanism for sharing data that allows the implementation of copy-paste and drag-and-drop. maybe its your fault : dont use or support desktop that dont have implementation for standards like gnome or anything based on it and change to modern desktop for better and acceptable experience ps: cosmic desktop is still in Alpha but they have good devs try it and make issuse if you find bug or problem be change you want to see in |
Using libdecor would pull in a Cairo/Gtk dependency, which is something I'm opposed to. I looked into using the current icon theme for drawing caption buttons though and at the moment this seems doable. |
are you planning to support Client-side decoration (CSD) just for wayland ? |
Interesting (and frustrating) that libdecor goes for Cairo rather than Skia, but yeah I don't see why accomplishing CSD on Mutter would be too difficult. The question is of course, do we bother trying to conform to Mutter's design language or not. |
I am going to close this PR as it's not active and more work is pending from our side (i.e. CSD). |
What does the pull request do?
Add a Wayland backend for Linux.
This PR is based on the previous one with significant bug fixes and easier maintenance .
In order to test this PR, locally building NWayland NuGet packages is required:
git clone --recursive https://github.com/affederaffe/NWayland
next to theAvalonia
directory├── Avalonia
│ ├── samples
│ ├── src
│ ├── ...
├── NWayland
│ ├── src
│ ├── ...
Navigate to
./NWayland/src/NWayland.Scanner
anddotnet run
to generate the bindings.Then
dotnet build -c Release
the./NWayland/src/NWayland
and./NWayland/src/NWayland.Protocols.Plasma
projects, which creates the required NuGet packages.These steps won't be necessary once NWayland is released officially on NuGet.
TODOs:
What is the current behavior?
XWayland is used in order to run Avalonia apps on Wayland systems.
What is the updated/expected behavior with this PR?
Use Wayland instead of X11 on compatible systems.
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
None
Obsoletions / Deprecations
None
Fixed issues
Fixes #1243
Fixes #2338