The ongoing work bit by bit to get Wine and Wayland to fully work together on Linux has taken another step, with a third big merge request accepted. Wine 8.4 from mid-March was the first development release to actually have some of the initial Wayland work in it.
From the merge request that's now accepted:
This MR introduces the driver mechanisms to handle dynamic events from the Wayland compositor, using wl_output events as the guiding use case (i.e., we want to update the win32u display settings when the host settings change).
In this design we create a dedicated thread to read and dispatch Wayland events received from the compositor. If a Wayland event handler wants some code to be run in the context of a particular HWND's thread, it can add an internal event to a custom queue we have for each (GUI enabled) thread. The ProcessEvents driver callback processes internal events from that queue. In order to wake up waiting threads we use a pipe to notify about new internal events, with the read end acting as the thread's host queue fd. This is similar to how winemac.drv works.
We use the aforementioned mechanisms to queue win32u display device updates to the desktop window thread. Since there are many pieces that need to fall into place, this MR gradually reaches the final design:
- We first introduce the dedicated read/dispatch thread and handle events (and also display device updates if in the desktop process) in that thread.
- We ensure access to Wayland output information is thread-safe and consistent (since in step 3 we will need to access it from a different thread).
- We finally introduce per-thread internal event queues and, if we are in the desktop process, queue the display device update to the desktop window thread internal event queue. Note that the main portion of the wl_output event code is still handled in the dedicated read/dispatch thread.
Why is this actually needed? Well currently Wine uses X11, and so for anyone running Wayland it will then be run through XWayland, which is basically X running under Wayland like a compatibility layer. As Collabora said in their original announcement back in 2020 talking about it they said it's "a source of complexity and possible inefficiencies" and so it would "be ideal if Wine could talk directly to Wayland to enable a leaner and more efficient stack on modern systems"
So the end result should be for users on Wayland, which will eventually be everyone, to have Wine work without the XWayland layer and have it all work nicely far into the future.
Quoting: drjomsSo in a nutshell, direct or indirect consequence of this - we shall have wine/proton working natively with Wayland?
yes exactly. The big question is "when" - I think I've been hearing some version of this exact same statement for years now. It's always "coming soon" so we shall see. For now I'm still on x11 just because it irks me to switch to wayland and then for all my games it's just running x on top of wayland. Why not just run x natively. I'll be very glad when it runs natively on wayland! But the when ...
Quoting: JarmerQuoting: drjomsSo in a nutshell, direct or indirect consequence of this - we shall have wine/proton working natively with Wayland?
yes exactly. The big question is "when" - I think I've been hearing some version of this exact same statement for years now. It's always "coming soon" so we shall see. For now I'm still on x11 just because it irks me to switch to wayland and then for all my games it's just running x on top of wayland. Why not just run x natively. I'll be very glad when it runs natively on wayland! But the when ...
I have been using Xfce4 for many years now. Switched over to Gnome with wayland. I am not picky about my GUI.
As long as i can run browser, terminal and switch easily between windows - I am good.
Albeit gnome is a bit more technically problematic than xfce, but its "more feature rich" too.
Did not notice any performance issues and what not.
Xwayland has almost no overhead, less than 1% I understand.
So i tried gnome+wayland and stayed with it.
Quoting: fedecvAnyone got adaptive sync working on Nvidia cards with wayland?
No because I can't be bothered testing wayland when it still has the RTX Primary display 75hz+ login crash entire system dead bug. (you can bypass it, but cbf)
Last edited by TheRiddick on 25 May 2023 at 10:07 pm UTC
Quoting: Jarmeryes exactly. The big question is "when" - I think I've been hearing some version of this exact same statement for years now.
If you mean when for Wine itself - hopefully later this year. Once they merge all major pieces it will be possible to test and they'll probably focus on bugs that will be reported once more people will start using it.
If you mean when Wayland itself will be used more widely - you can check the trend in GOL stats for example.
https://www.gamingonlinux.com/index.php?module=statistics&view=trends#SessionType-top
You can probably correlate that trend with the growing trend of AMD GPUs usage, since experience with Nvidia on Wayland is worse.
Personally I've been using KDE Wayland session for a while already and it works well including for gaming.
Last edited by Shmerl on 25 May 2023 at 11:24 pm UTC
Quoting: ShmerlHmmm . . . that looks like a 15% increase in about a year and a half. So say 10%/year. At that rate it would get to almost half in two more years, over half in 3 years. But I suspect that although the progression is pretty even in the graph, the line is really quite straight, it will probably start curving up at some point as various distros decide Wayland is good enough.Quoting: Jarmeryes exactly. The big question is "when" - I think I've been hearing some version of this exact same statement for years now.
If you mean when for Wine itself - hopefully later this year. Once they merge all major pieces it will be possible to test and they'll probably focus on bugs that will be reported once more people will start using it.
If you mean when Wayland itself will be used more widely - you can check the trend in GOL stats for example.
https://www.gamingonlinux.com/index.php?module=statistics&view=trends#SessionType-top
Personally I've been using KDE Wayland session for a while already and it works well including for gaming.
Quoting: Purple Library GuyHmmm . . . that looks like a 15% increase in about a year and a half. So say 10%/year. At that rate it would get to almost half in two more years, over half in 3 years. But I suspect that although the progression is pretty even in the graph, the line is really quite straight, it will probably start curving up at some point as various distros decide Wayland is good enough.
Sounds right. It probably would accelerate once some major pieces will be improved and there would be less reasons to use X11.
And as I also added above, one of the factors is the GPU. Nvidia blob is the drag on Wayland usage due to it causing poor experience on it. But the trend for Nvidia is negative as you can see on the same page, so that will speed things up for Wayland adoption.
Last edited by Shmerl on 25 May 2023 at 11:34 pm UTC
See more from me