-
Notifications
You must be signed in to change notification settings - Fork 32
The ideal Wayland backend #28
Comments
Thanks for writing this up. I'd be interested to see how we could work with smithay client toolkit given that it exists to make client code easier. Do we lose anything? If not, it's probably the way to go? |
Smithay's client toolkit (sctk) is intended to provide composable components to implement some aspect of a client. Likely glazier will use sctk internally as developers using glazier probably don't need to too far under the hood. For the keyboard integration, you probably should use the built-in calloop event source to handle repeat events nicely assuming you don't choose to share keyboard logic with x11. For shells, sctk simply manages all the dirty configure logic and gives you a single notification with a non-exhaustive type to get info from. For other protocols that integrate into the configure sequence, we do provide the serial to assist with that, meaning further xdg-shell extensions should be possible. From the configure sequence, glazier can dispatch whatever events are needed. Creating a window currently kind of takes over the initial commit sequence. This will change as winit also has this issue. I have some work locally I need to finish for that. The data device stuff for 0.30 sctk is nearly done, it provides helpers and a way to wait for the write from the other clients or server to be done. Of course sctk for 0.30 is still a bit wip (once we iron out sctk 0.30, wayland-rs 0.30 will be released) so we are willing to accommodate glazier where needed. |
If there is help wanted for using sctk in the wayland backend, i'd be happy to contribute :) |
Yes! I've been poking at this, but very slowly because I haven't had much time. I just pushed my not-even-building WIP to here, and also an sctk+vello demo here. I'm happy to give you write access to those forks if you want to poke at it together, but given the current state I also won't be offended if you want to start your own fork. |
Ok, I'll take a look at what you've got. I'll probably work on my own fork though :) |
I remember simthay client toolkit missing quite a few features like support for layer-shell, changing the cursor bitmap, multi seat handling etc. That was about 5y ago, maybe things changed. I wrote my own implementation, mostly for fun then. Not sure if any of it is still relevant or useful. |
Currently, that's not a problem at all, sctk is just a bunch of helpers, you can implement any protocols you want, even private ones without the need for it to be supported upstream, layer shell is just so simple that there is nothing to abstract away. You just plug it's surface to sctk WlSurface module and that's it. That being said, it is abstracted away in the current version anyway, mostly because
Supported, and even if it was not, you can just pass sctk WlSurface to WlPointer::set_cursor manually and call it a day.
Supported |
In the process of unpiet, the Wayland backend needs some work under the hood as well. Since the backend is relatively immature, I'd recommend a rewrite of the Wayland backend while we are in progress with unpiet.
I may contribute some bits here and there in the future, but I am quite busy so I'll lay out the future ideal state of the Wayland backend:
A few implementation notes that would be useful:
And some implementation advice for fulling the scope of glazier:
wl_keyboard
, possibly some seat related stuffzwp_input_method_v1
protocoltablet-unstable-v2
protocol for drawing tablets.wl_pointer
.wl_data_device
A few things worth discussion here include:
idle-inhibit
protocol)There are some less clear, but nice things we could support that are more Wayland specific:
The text was updated successfully, but these errors were encountered: