Check out our Monthly Survey Page to see what our users are running.
We do often include affiliate links to earn us some pennies. See more here.

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 initial xdg_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 new wl_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 the window_surface to minimize copying of data from the window_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.

Article taken from GamingOnLinux.com.
17 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly checked on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly.
See more from me
The comments on this article are closed.
8 comments

Yorimirus Jun 30, 2023
Amazing work! Great to see more and more things supporting wayland. I wonder what kind of performance improvements will we see on the Steam Deck once Wayland is fully supported?
elmapul Jun 30, 2023
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?
Shmerl Jun 30, 2023
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
elmapul Jun 30, 2023
Quoting: Shmerl
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.

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.
Shmerl Jun 30, 2023
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
Pyretic Jul 3, 2023
So how far along is it?
Shmerl Jul 3, 2023
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.
DMJC Jul 4, 2023
Quoting: elmapul
Quoting: Shmerl
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.

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.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.