At the end of 2020 Collabora announced its intentions to create a controller for Wine in order to work with Wayland, since on Linux, Wine uses X11 to interact with the X11 display server. In many modern systems the Wayland protocol is, by design, more restricted compared to more traditional display systems like X11 and win32, presenting a unique set of challenges in integrating Wayland with Wine.
Three months after that, Collabora presented the first update of the controller in which the improvements presented were the bidirectional work between Wine and Wayland in the most essential basically, even though the controller presented many errors and especially with the scaling of the windows.
For the past few months, we have been improving the experimental Wayland driver for Wine, which allows Windows applications to run directly in Wayland composers. Our goal is to eventually eliminate the need for XWayland for many use cases and thus reduce the overall complexity of the system while eliminating points of potential inefficiency.
Now after almost 7 months of work an improved version has been presented of the Wayland driver that allows running applications using GDI and OpenGL / DirectX through Wine directly in a Wayland-based environment, without using the XWayland layer and getting rid of Wine's binding to the X11 protocol.
About the new version of the driver
In this new version Vulkan support introduced and also comes with window management handling with which the change of size, full screen, minimization, among other actions is no longer a problem, in addition to that and it can be used directly or to implement Direct3D through WineD3D or DXVK.
Collabora developers mention that Wayland's controller now has the support to work on several monitors to Wine and supports dynamic addition and removal of monitors. It also supports changing the app-perceived resolution of each monitor (via composer scaling, see update above) to implement per-monitor mode changes.
Also changing the resolution and mode of each monitor is supported and scaling for HiDPI and working with high pixel density (HiDPI) displays is provided.
Finally, it is also mentioned that the handling of keyboard layouts has been implemented in Wayland and support for clipping and relative movement of the cursor has been added.
With this new version, the controller is getting closer to being functional for general use, in addition to the fact that conversations with Wine developers continue on the issue of including the Wayland help in the Wine staging branch with subsequent transfer to the main composition of Wine.
About it Alexandros Frantzis (Collabora developer) shared:
»I think the controller has reached a point where it has enough features to be useful for many use cases and also provides enough confidence that it is a viable option in the future. My plan now is primarily to focus on fixes / enhancements and start preparing for the staging by creating a series of more revision-friendly / upstream patch sets. '
Finally if you are interested in knowing more about it, you can check the details in the following link.
Build the controller
For those who are interested in being able to obtain, build and / or use the Wayland driver for Wine, they should know that it is required to have Wayland installed as well as wayland-client, wayland-egl and xkbcommon development.
The construction of the controller can be done by opening a terminal and in it they will type the following commands:
git clone -b wayland https://gitlab.collabora.com/alf/wine/ cd wine ./configure --with-wayland [--with-vulkan --with-vkd3d] make [-jN] DISPLAY= WAYLAND_DISPLAY=wayland-0 ./wine ...
To learn more about the compilation process or obtain the source code, you can do it In the following link.