Almamu / linux-wallpaperengine

Wallpaper Engine backgrounds for Linux!
GNU General Public License v3.0
1.59k stars 61 forks source link

Feature Request: Add wlroots support to linux-wallpaper engine #137

Closed camatthew closed 1 year ago

camatthew commented 1 year ago

If we make this compatible with wlroots desktops and make it draw on the background layer, it should be able to support any linux desktop environment / compositor based on wlroots.

Almamu commented 1 year ago

Currently theres no support for Wayland implemented at all (and I don't use wayland myself either) so I don't really know where to begin... I'll definetly take a look sometime in the future.

vaxerski commented 1 year ago

I could write a Wayland impl, however I am unsure whether we should use wlr-layer-shell-v1 which is supported in wlroots and KDE, but not Guhnome, or wait for ext-layer-shell-v1

Well, unless GLFW already supports rendering to a LS, in which case this would be easier. Idk if it does, tho.

Edit: https://github.com/glfw/glfw/pull/2061/ I guess we should push this and then we can write a simple impl here.

vaxerski commented 1 year ago

Looking at the glfw mr and stuff, it seems like they're planning to take a very reasonable approach and plan out the thing to be more x-platform, which might take some time.

We don't need that here, so if @Almamu is interested in getting this done, I can have a stab at writing a Wayland driver manually myself. Pretty sure that the Wayland driver would have to be glfw-free, though.

Almamu commented 1 year ago

@vaxerski Sure, PR are always welcome!

There's some challenges that I'm not sure how we could solve that might need some thought before starting a Wayland implementation:

I don't have much experience with these as usually libraries like SDL2 or GLFW do handle it, and packaging also needs to be taken into account for the build system. Ideally one package would cover both X11 and Wayland without the need of rebuilding...

vaxerski commented 1 year ago

My thought was to have a wayland driver alongside the X11 one, but as an optional. If no wayland libs are found, it's not built. If they are found, it will be used if WAYLAND_DISPLAY is set. Otherwise, the X11 one will be used.

We could do the same for X11 support, that is, to throw it out if no X11 libs are present.

What about the X11-specific code?

Most of it is in the driver, from what I looked around. Some glfw code here and there could just be if()d depending on the platform.

Also, a bit offtopic, but something's wrong with this at least for me on xwayland, it runs at a solid 1FPS and seems to have artifacts. I'll try to see later.