Almamu / linux-wallpaperengine

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

Rendering to the background of i3 - success! #139

Closed jthistle closed 8 months ago

jthistle commented 1 year ago

wallpaperengine

Hi - I just thought I'd say that I've managed to develop a way to get this to work by modifying GLFW itself. I would very much like to help bring this functionality into the project, but I'm not quite sure what the best way to go about it is.

I imagine that it would probably involve forking GLFW, applying the changes that I've made, and moving it all to this project, then compiling it as a dependency along with the rest of the stuff. Would this be an acceptable thing to do? It would complicate things further by adding yet another thing that needs compiling, but it would be much quicker and simpler than the alternative, which would be for me to try to get my changes into upstream GLFW.

By the way, if you want to try it out, you need to:

  1. Clone my version of GLFW.
  2. Build it with the flag -DBUILD_SHARED_LIBS=ON set on cmake.
  3. Remove your existing installation of libglfw3 and libglfw3-dev.
  4. Symlink the built shared object libglfw.so to /usr/lib/libglfw.so.3.4 and .so.3 & .so.3.4.
  5. Copy the glfw3.h file from the forked GLFW repo to ./include/GLFW/glfw3.h in this project.
  6. Edit main.cpp to make the call to glfwCreateWindow a call instead to glfwCreateDesktopWindow.
  7. Clean and build linux-wallpaperengine.
  8. ????
  9. Profit!
Almamu commented 1 year ago

I'll take a look at the changes on the repo you shared, in theory we got i3 rendering working, but it breaks as soon as a compositor (like picom) is running: https://github.com/Almamu/linux-wallpaperengine/blob/main/src/WallpaperEngine/Render/CContext.cpp#L91

jthistle commented 1 year ago

I think this should work with compositors, but not 100% sure - unfortunately I don't use a compositor myself so I can't tell.

in theory we got i3 rendering working

I did try this initially with --screen-root but it didn't seem to work for me...

Almamu commented 1 year ago

I'll give it a try with picom once I have some free time. --screen-root should work fine with i3 as long as you specify the right screen name. If it does not work It'd be good if you could share some info on your setup: GPU (and driver version in the case of NVIDIA) any output in the console?

jthistle commented 1 year ago

Haha, I tried again now and it does work... I wonder what I missed the first time. Anyway, maybe what I've done will still be useful for those with compositors, I don't know.

trainzkid commented 8 months ago

Is this still an issue? I'm running i3 + picom with this app successfully

jthistle commented 8 months ago

It was never an issue, I'm just dumb lol, closing