The fourth part of an ongoing series of submission to Wine to get full Wayland support has been merged in. The merge request was opened 4 weeks ago, and it was merged into the Wine project on June 29th.
With the focus of this most recent work to give the "minimum necessary infrastructure to display the contents of some simple, software rendered windows" as detailed by the developer it involved two major steps:
- Associate a window with a Wayland surface and give it the
xdg_toplevel
role, so that the compositor can display it. We also have to implement the required initialxdg_surface
configuration sequence to be able to safely (i.e., without the compositor disconnecting us with an error) attach buffers to the surface in step (2).- Implement the
window_surface
interface for the Wayland driver. For now we provide a simple (and suboptimal)window_surface_flush
implementation: for each flush we create a newwl_shm
buffer, copy the whole window contents (ignoring damaged bounds for now) into it and attach it to the target Wayland surface. In the next MR I will optimize this implementation in multiple ways: a. implement a buffer queue to avoid constantly allocating new buffers b. respect the damaged bounds of thewindow_surface
to minimize copying of data from thewindow_surface
to the SHM buffer (and also for correctness) c. communicate damaged surface regions to the compositor to (potentially) allow more efficient texture uploads.
Thanks to this work many software rendered applications can now actually display dynamic content on screen with Wayland but you can't interacct with them just yet. Small steps but it's a pretty big project to get moving from X11 to Wayland.
For those of you not clear on why it's needed: Wine currently needs X11 and so if you're on Wayland you'll be running things through XWayland (basically X running under Wayland like a compatibility layer). This adds more complexity to it and more ways performance could be reduced. Obviously the ideal situation is to just have Wine and Wayland talk directly with no extra middle layer.
The end result will mean Wine will work on Wayland without needing XWayland. This work should be in the next release with Wine 8.12 due out next weekend with their usual bi-weekly development releases.
QuoteThe end result will mean Wine will work on Wayland without needing XWayland. This work should be in the next release with Wine 8.12 due out next weekend with their usual bi-weekly development release
what about games and applications that only work on older versions of wine?
any one is back porting those changes to older wine versions? or we will have to XWayland then all the way?
Quoting: elmapulwhat about games and applications that only work on older versions of wine?
That shouldn't normally happen. If it does, it's a bug that should be reported as a regression.
Last edited by Shmerl on 30 June 2023 at 9:19 pm UTC
Quoting: ShmerlQuoting: elmapulwhat about games and applications that only work on older versions of wine?
That shouldn't normally happen. If it does, it's a bug that should be reported as a regression.
the issue is , how to test everything that exist for each version of wine?
in theory we can write some unit tests for the apis , in pratice countless things can happen that break the program despite the test saying it should work.
Quoting: elmapulthe issue is , how to test everything that exist for each version of wine?
in theory we can write some unit tests for the apis , in pratice countless things can happen that break the program despite the test saying it should work.
They have some tests, but in the end, someone has to care about some obscure application to report it breaking. If no one does - then I guess it's not really impacting things.
I think they get some regression reports either way and try to address them.
Last edited by Shmerl on 30 June 2023 at 10:34 pm UTC
Quoting: PyreticSo how far along is it?
May be around half way? Not yet enough to play games. But it's preparing needed parts for it.
Quoting: elmapulQuoting: ShmerlQuoting: elmapulwhat about games and applications that only work on older versions of wine?
That shouldn't normally happen. If it does, it's a bug that should be reported as a regression.
the issue is , how to test everything that exist for each version of wine?
in theory we can write some unit tests for the apis , in pratice countless things can happen that break the program despite the test saying it should work.
I've just done regression testing on Wing Commander: Secret Ops and Wing Commander: Prophecy. I've submitted a bug to the WINE developers to fix ntdll/heap.c in WINE. This is not super common, but it does need to happen every now and then. The bigger problems in WINE are more around colour depth switching etc. I'd love it if Wayland fixed it but I suspect they haven't done anything about 16/32-bit colour switching.
See more from me