Wayland support for vsg #1099
Replies: 21 comments 29 replies
-
|
Prequesites
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks for posting your work on Wayland support. I just got back from a day our so only done a quick code review. If I have an opportunity tomorrow I will try it out on Kubuntu 22.04 desktop. After my first once through questions/suggestion that spring to mind are:
What were the Qt problems? The way vsgQt works is to use Qt to create the window but defer the vkInstance and vkSurface creation to the VSG's vsg::Window/Surface classes, with the vsg::Window subclass taking the Qt native window id from the WindowTraits. The Win32_Window.cpp and Xcb_Window.cpp both do this so you can look them to see what they do. |
Beta Was this translation helpful? Give feedback.
-
|
glfw has a Wayland implementation. glfw is what I used as my once of reference for learning how to do Xcb/Vulkan integration. W.r.t multiple libraries vs a single library, I have tried to keep things simple for developers with the ability to just link to single library if all they need is basic 3d rendering and loading of native file formats. There are pros and cons for doing single and multiple libraries, supporting multiple windowing backends at the same time makes multiple dynamic libraries preferable but so far this possibility hasn't existed for the VSG - we've only had one implementation per platform. The input device issue does sound problematic for Wayland, I can't believe the situation is so bad. I was expecting modern well handled solutions rather than a regression on decades old X11's capabilities. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the link. Seems a sorry state of affairs that Wayland has been pushed as being ready for prime time long before it is. If you come up with helpful links to KDE/Qt+Wayland discussions/code please post them here. I expect others will be interested in the topic of Wayland support. I don't know if this OpenSceneGraph PR will help, it's a bit old now. Unfortunately I've been so swamped with VSG related work that I haven't had a chance to review this PR, let along merge it, so I can't say whether it will help with aspects but it might provide another perspective: |
Beta Was this translation helpful? Give feedback.
-
|
I don't now if this might be workable, but perhaps we could dynamically load native windowing libraries at runtime and get the function names to use rather than compiling directly against the library. This approach would provide the flexibility of not needing to directly link the VSG to a specific native windowing library. This approach is essentially what we do with the vsg::InstanceExtensions and vsg::DeviceExtensions classes for handling Vulkan extensions. However, it's more complicated and more work to implement and use than just using a libraries functions directly. |
Beta Was this translation helpful? Give feedback.
-
|
To help wider testing I have merged @VasanthBalguri's wayland-testing branch into the main VulkanSceneGraph repo as the branch: https://github.com/vsg-dev/VulkanSceneGraph/tree/VasanthBalguri-wayland-testing You'll need to set the CMake var BUILD_WAYLAND to 1 as per the instructions in the first post in this thread. I have now a build of the VSG, vsgXchange etc. & vsgExamples and everything builds, though there are many warnings on the VSG build that we'll need to address in time, no worries there. When I run on vsgviewer on my system I do see an exception through about lack of wayland support: $ vsgviewer models/lz.vsgt I am using Kubuntu 22.04 right now so I'll need to look into whether it's possible to enable a Wayland back-end. I'm a newbie on Wayland so happy to stumble through and learn as I go. -- On the topic of references for Wayland support, perhaps SDL might also be another reference we can look at for inspiration. Another thought, I believe Wayland is common on automotive infotainment systems, the OSG found a home in this market, the VSG is now a much more natural fit than OSG as it's smaller, faster and more modern, so Wayland support might help those considering the VSG in this embedded market. The question I would raise would be about what happens with event handling on embedded Wayland platforms, I wouldn't be surprised if libxkbcommon isn't a thing, though.... I haven't kept up with recent automotive platforms so this hunch might well be off. If it's right though we might want to make it an optional code path. |
Beta Was this translation helpful? Give feedback.
-
|
I have now installed the wayland-plasma and selected this on log-in but when I run vsgviewer I see a new error: vsgviewer models/lz.vsgt
Authorization required, but no authorization protocol specified |
Beta Was this translation helpful? Give feedback.
-
|
I am now testing the wayland-testing branch on my Ubuntu 22.04 laptop and found I had to install wayland-protocols in addition to libxkbcommon-dev and libwayland-dev, so the install dependencies line is: sudo apt install libxkbcommon-dev libwayland-dev wayland-protocolsEverything compiles OK, but still haven't got things working cleanly when I run vsgviewer I get a seg fault: #0 0x00007ffff7f23e34 in wl_proxy_get_version () from /lib/x86_64-linux-gnu/libwayland-client.so.0 Will need to check the Wayland status of Ubuntu 22.04 |
Beta Was this translation helpful? Give feedback.
-
|
Hi Robert,
Seems like there are many issues.
I was able to get mine up and running, but seems like I didn`t provide
enough info.
I run following system:
Kubuntu 22.04
Kde plasma 5
I am away and I dont have access to my computer will be back on March 11 to
verify.
I built mine on version 1.1.0 as I got compilation errors on latest version.
I will try to setup a VM and verify different distros once I am back home
Regards,
Vasanth
…On Sun, 25 Feb, 2024, 10:44 pm Robert Osfield, ***@***.***> wrote:
I am now testing the wayland-testing branch on my Ubuntu 22.04 laptop and
found I had to install wayland-protocols in addition to libxkbcommon-dev
and libwayland-dev, so the install dependencies line is:
sudo apt install libxkbcommon-dev libwayland-dev wayland-protocols
Everything compiles OK, but still haven't got things working cleanly when
I run vsgviewer I get a seg fault:
#0 0x00007ffff7f23e34 in wl_proxy_get_version () from
/lib/x86_64-linux-gnu/libwayland-client.so.0
#1 <#1>
0x00005555557d6cbc in
vsgWayland::Wayland_Window::Wayland_Window(vsg::ref_ptrvsg::WindowTraits) ()
#2 <#2>
0x00005555557d6e55 in vsg::Window::create(vsg::ref_ptrvsg::WindowTraits) ()
#3 <#3>
0x0000555555636b32 in main ()
Will need to check the Wayland status of Ubuntu 22.04
—
Reply to this email directly, view it on GitHub
<#1099 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6DBOIQFLWHK25QZDS7PC3YVNWORAVCNFSM6AAAAABDX4JUAOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKOBUGMYTE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
Hi Robert,
Yes the xkb is exclusive to linux desktop, although automotive uses linux
kernel, it is not garuntee to be present there.
I was initially in the same dillema, but got over it as I had no other
option.As wayland has no standard for keboard mapping and it is upto the
compositor to decide it.
My compositor sends the raw values stored in linux/input.h header file, so
it is common on all linuxs I suppose.
Regards,
Vasanth
…On Sun, 25 Feb, 2024, 10:00 pm Robert Osfield, ***@***.***> wrote:
To help wider testing I have merged @VasanthBalguri
<https://github.com/VasanthBalguri>'s wayland-testing branch into the
main VulkanSceneGraph repo as the branch:
https://github.com/vsg-dev/VulkanSceneGraph/tree/VasanthBalguri-wayland-testing
You'll need to set the CMake var BUILD_WAYLAND to 1 as per the
instructions in the first post in this thread.
I have now a build of the VSG, vsgXchange etc. & vsgExamples and
everything builds, though there are many warnings on the VSG build that
we'll need to address in time, no worries there. When I run on vsgviewer on
my system I do see an exception through about lack of wayland support:
$ vsgviewer models/lz.vsgt
vsgviewer models/lz.vsgt
[Exception] - failed to create Wayland connection result = 0
I am using Kubuntu 22.04 right now so I'll need to look into whether it's
possible to enable a Wayland back-end. I'm a newbie on Wayland so happy to
stumble through and learn as I go.
--
On the topic of references for Wayland support, perhaps SDL might also be
another reference we can look at for inspiration.
Another thought, I believe Wayland is common on automotive infotainment
systems, the OSG found a home in this market, the VSG is now a much more
natural fit than OSG as it's smaller, faster and more modern, so Wayland
support might help those considering the VSG in this embedded market. The
question I would raise would be about what happens with event handling on
embedded Wayland platforms, I wouldn't be surprised if libxkbcommon isn't a
thing, though.... I haven't kept up with recent automotive platforms so
this hunch might well be off. If it's right though we might want to make it
an optional code path.
—
Reply to this email directly, view it on GitHub
<#1099 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6DBOJLEOCYQ76Z6LEGRITYVNRKNAVCNFSM6AAAAABDX4JUAOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKOBUGA2TE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
Hi Robert, Sorry for delay, I was busy with personal and professional work. I will try merge 1.1.4 release changes and add logging facility to this branch soon enough. feel free to message me regarding anything. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @VasanthBalguri, great work here. Do you still have any interest in working on this? |
Beta Was this translation helpful? Give feedback.
-
|
Hi Nolan,
It has been a while since I worked on it, I have seen that wayland is a
very fragmented and opinionated framework.
This made it challenging to implement the windowing especially multi
windowing.
Like Gnome has its own api for window decorations, KDE uses its own api,
wlroots uses its own api. Not only that
the maintainers of wayland had a plausible deniability saying "wayland is
just api". So I was focusing on KDE back then.
There were some glitches especially while using QT which made it more
frustrating.
As of now wayland might have matured more but when I was working that was
the case. I can maybe explain
what I have done but beyond that I don't have bandwidth for proceeding on
this endeavor, at least for this year and next.
Regards,
Vasanth
…On Thu, Dec 11, 2025 at 12:38 AM Nolan Kramer ***@***.***> wrote:
Hey @VasanthBalguri <https://github.com/VasanthBalguri>, great work here.
Do you still have any interest in working on this?
—
Reply to this email directly, view it on GitHub
<#1099 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6DBOPOXGX2TYZJJCBYFIT4BBVTNAVCNFSM6AAAAACOU2KFE6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMRSGMZTIMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the detailed response @VasanthBalguri ! Very helpful! Just to keep this thread alive and keep track of things, since I know Wayland is the future forward, I'd like to bring to light some information: As of now, 2025 (almost 2026), many of the functions used in the wayland branch now have stable API and are universal. This makes using functions like:
Reliable. The It also comes highly recommended to use BUT like I highlighted earlier - many of the protocols that could be opinionated/fragmented are now standard. This is excellent news for bringing a stable Wayland implementation into VSG. A question for @robertosfield - how do you feel about using And additionally, how do you feel about using Are there specific automotive Wayland compositors or protocols (AGL, ivi-shell, etc.) that VSG needs to target? Or is standard xdg-shell with fullscreen support sufficient for those use cases? I think most of Vasanth's code here is actually pretty good, it just needs some API updates, cleanup, and perhaps additional fallback code here and there. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Nolan,
Thanks for the input Nolan, I think I got motivated again to work on it :D.
I will need some time though as I am going through a career transition.
When I was working wlroots and kde seemed to be the closest to the desktop
but then again it is opinionated and weakly documented.
This is good news if the protocols are standardized for all the
compositors, is the multi window protocol also standardized as of now?
My inputs with regards to decoration is that, we should prefer Server side
decoration as it will keep it uniform for the client.
If libdecor can achieve that it is good, but keep in mind that it will add
more dependencies which will add technical debt.
From what I understand VSG is a middleware not a client application so it
should be the responsibility of the developer to
provide decorations, our responsibility is to provide the interface,
@robertosfield <https://github.com/robertosfield> please add your inputs.
Maybe once I am free I will build and test against the latest codebase, the
2 challenges I faced are following:
Unable to make multi window examples work and unable to make it work with
QT window.
Links for reference:
https://wayland.app/protocols/
openscenegraph/OpenSceneGraph#1170
Regards,
Vasanth
…On Tue, Dec 30, 2025 at 5:11 AM Nolan Kramer ***@***.***> wrote:
Thanks for the detailed response @VasanthBalguri
<https://github.com/VasanthBalguri> ! Very helpful!
Just to keep this thread alive and keep track of things, since I know
Wayland is the future forward, I'd like to bring to light some information:
As of now, 2025 (almost 2026), many of the functions used in the wayland
branch now have stable API and are universal. This makes using functions
like:
- zxdg_decoration_manager_v1 (now use xdg-decoration)
- zxdg_output_manager_v1 (now use xdg-output)
- xdg_wm_base (xdg-shell has been stable for awhile)
Reliable.
The wp_ prefix protocols (like wp_viewporter, wp_fractional_scale_v1) are
now the standard path.
It also comes highly recommended to use libdecor to get window
decorations, instead of trying to do decorations ourselves. Decorations
are, like Vasanth said - highly opinionated - and it makes little sense for
VSG to handle that in my opinion.
BUT like I highlighted earlier - many of the protocols that could be
opinionated/fragmented are now *standard*. This is excellent news for
bringing a stable Wayland implementation into VSG.
A question for @robertosfield <https://github.com/robertosfield> - how do
you feel about using libdecor to help with window decorations?
And additionally, how do you feel about using glfw or sdl to help with
the entirety of window creation, or would you rather that be done by VSG (
glfw or sdl are pretty heavy/bring in a lot, so I'd understand avoiding
them - BUT they also have good wayland window creation routines, and we
could just grab the window handle from them)?
I think most of Vasanth's code here is actually pretty good, it just needs
some API updates, cleanup, and perhaps additional fallback code here and
there.
—
Reply to this email directly, view it on GitHub
<#1099 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6DBOL5S5M4O52SQLAD2A34EG34LAVCNFSM6AAAAACOU2KFE6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMZXGE3TMMI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
I haven't yet worked with Wayland beyond my testing of the VasanthBalguri-wayland-testing branch back when @VasanthBalguri submitted it in 2024, it wasn't yet ready for prime-time back then. To help with testing I've merged VSG master into the VasanthBalguri-wayland-testing branch and would welcome folks updating it to work with the latest state of art of working with wayland. W.r.t using SDL or glfw, an easy answer: absolute not. They simply don't provide the capabilities we need in the form we need and add dependencies and build complexity, and design/implementation wise we don't need to insert yet another abstraction layer between user applications and the OS/drivers/harder. Users of the VSG should be able to use SDL, glfw, Qt etc. if they so wish, but for most users the built-in Windowing support will be more appropriate, and where it doesn't quite meet this we need to refine things further. W.r.t adding libdecor as a dependencies for the users that want to use wayland, could it be made option? I can imagine some users would just want to create an embedded application that would never need window decoration and libdecor might not even support all the embedded platforms that users might want to use the VSG in. |
Beta Was this translation helpful? Give feedback.
-
|
@robertosfield and @nolankramer , gave it a try with 1.1.13 version following is the issue with multi window as per vsg::Qt i think issue is primarily that we are embedding our window inside QMainwindow, which is not properly embedding in case of wayland. in Window.cpp line 149 #if defined(VK_USE_PLATFORM_WIN32_KHR) this is how it is mapped, think @robertosfield mentioned that we are deliberatley doing this as QT support for vulkan is not good at the time. Here as well I need to figure out how we can make it work for QT. There seems to be an issue on QT5 which is not fixed: Also one thing I noticed is that window resizing is laggy, need to check this as well |
Beta Was this translation helpful? Give feedback.
-
|
As a general comment. One of the design & implementation features that I've had in mind from the first implementation of the platform windowing support was added to the VSG was that it would eventually evolve into an API that allow multiple implementations to be compiled into the VSG and then selected from at runtime. For instance if we have Xcb and Wayland on a platform then we might want to build the VSG with both Xcb and Wayland support and then enable applications to select which windowing implementation to use. This would allow vsgQt or other applications/libraries to select between the backend implementation required. |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
I have merged @VasanthBalguri's latest work on wayland support with a new wayland-latest2 branch: https://github.com/vsg-dev/VulkanSceneGraph/tree/wayland-latest2 I have left the original work as the branch wayland-latest. |
Beta Was this translation helpful? Give feedback.
-
|
I have built the VSG, vsgXchange and vsgExamples with the wayland build option and then when running vsgviewer I get: $ vsgviewer models/teapot.vsgt
vsgviewer models/teapot.vsgt
[Exception] - failed to create Wayland connection result = 0I will have a look at logging into KDE with Wayland used rather than X11. |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I am working on wayland support for vsg, I would like to share my progress:

⚠️ Limitations: (Help appreciated 🙏)
I added my commits over 1.1.0 release as it seems stable...
👇 How to get it:
I am open for any feedback or queries 😄
Beta Was this translation helpful? Give feedback.
All reactions