Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] wallpaper-engine-for-kde-plugin integration #167

Open
Mufanc opened this issue Aug 11, 2024 · 3 comments
Open

[FR] wallpaper-engine-for-kde-plugin integration #167

Mufanc opened this issue Aug 11, 2024 · 3 comments

Comments

@Mufanc
Copy link

Mufanc commented Aug 11, 2024

I'm not very familiar with Linux GUI development, so if there's anything incorrect in my following statements, I apologize in advance.

I noticed that it seems possible to embed any Gtk.ApplicationWindow into the desktop as wallpaper in this project. On the other hand, there is a KDE plugin called wallpaper-engine-kde-plugin that can render certain scenes from Wallpaper Engine as wallpapers. This project has a standalone running mode that allows Wallpaper Engine wallpapers to be rendered in an independent window. Therefore, I created a proof of concept that embeds a standalone mode QT window into a GTK window using GtkSocket. I would like to know if this method can be relied upon to achieve the integration of Hidamari and Wallpaper Engine.

Also see poc.sh

@Mufanc
Copy link
Author

Mufanc commented Aug 13, 2024

I have made some simple replacements to the web_player to prove its feasibility. However, due to Wayland's limitations, I had to add the GDK_BACKEND=x11 environment variable to make it work.

image
image

@jeffshee
Copy link
Owner

jeffshee commented Aug 18, 2024

@Mufanc Thanks for taking your time to experiment with Hidamari! It's fascinating to realize that you can embed a QT widget into GTK, which I never considered before.

However, there is also a limitation when using the embed approach, as you mentioned that it needs to rely on X11/XWayland. Also GtkSocket has been removed since GTK4. (Just to clarify, the renderer part could use other technologies, including QT. It doesn't need to share the same technology stack with the frontend, but it will be better to do so to decrease the number of dependencies.)

I intend to rewrite the renderer part in gtk4-rs (the POC is still in progress and I will make it public at some point). I might be interested in including support for the Wallpaper Engine's scene wallpaper if there is a way we can draw it onto a Gtk4 widget.

After looking at the mentioned standalone app's sources, I realize that it uses the scene backend declared here. That scene backend then uses the scene wallpaper class declared here, which is something that I believe is implemented with pure Vulkan codes without QT dependencies. (Please forgive me if I made any mistake on this statement, I had never coded in C++ before.)

I guess we might be able to use only the Vulkan part and display it in the Gtk4 widget, just like what the standalone app has done: scene wallpaper (Vulkan) → scene backend (QML, with shared OpenGL texture) → standalone app (QML Viewer).

@moetayuko
Copy link

moetayuko commented Oct 20, 2024

wallpaper-engine-kde-plugin has split its rendering part into a standalone project, which does not have QT dependencies. Besides, a GLFW demo is provided at https://github.com/fxzjshm/wallpaper-scene-renderer/blob/master/standalone_view/glfwviewer.cpp

I guess it's much easier and less tricky to embed it now, as a pure opengl widget. the renderer uses vulkan, I'm not sure if embedding vulkan in gtk3 is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants