feat: initial video wallpaper implementation
C++ / fmt (pull_request) Failing after 10s
C++ / build (pull_request) Failing after 11s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 8s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 35s
Python / verify (pull_request) Failing after 1m32s
Rust / build (pull_request) Successful in 1m0s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 1m4s

This commit is contained in:
2026-10-24 23:28:17 +02:00
parent 187e97a081
commit f858fc5e9e
14 changed files with 1280 additions and 88 deletions
+45 -2
View File
@@ -53,6 +53,11 @@ WallpaperSurface::WallpaperSurface(
}
WallpaperSurface::~WallpaperSurface() {
if (m_frameCallback) {
wl_callback_destroy(m_frameCallback);
m_frameCallback = nullptr;
}
if (m_eglSurface != EGL_NO_SURFACE)
eglDestroySurface(m_service->m_eglDisplay, m_eglSurface);
@@ -68,8 +73,45 @@ WallpaperSurface::~WallpaperSurface() {
if (m_surface) wl_surface_destroy(m_surface);
}
void WallpaperSurface::redraw() {
m_service->queue(this);
void WallpaperSurface::markDirty() {
m_dirty.store(true, std::memory_order_relaxed);
}
bool WallpaperSurface::needsDraw() const {
return m_dirty.load(std::memory_order_relaxed);
}
bool WallpaperSurface::frameReady() const {
return m_frameReady.load(std::memory_order_relaxed);
}
void WallpaperSurface::requestFrame() {
if (!m_surface || m_frameCallback) return;
m_frameCallback = wl_surface_frame(m_surface);
static const struct wl_callback_listener listener = {
[](void* data, struct wl_callback*, uint32_t) {
static_cast<WallpaperSurface*>(data)->onFrameDone();
},
};
wl_callback_add_listener(m_frameCallback, &listener, this);
}
void WallpaperSurface::onFrameDone() {
if (m_frameCallback) {
wl_callback_destroy(m_frameCallback);
m_frameCallback = nullptr;
}
m_frameReady.store(true, std::memory_order_relaxed);
m_service->wake();
}
void WallpaperSurface::endDraw() {
m_dirty.store(false, std::memory_order_relaxed);
m_frameReady.store(false, std::memory_order_relaxed);
}
void WallpaperSurface::zwlr_layer_surface_v1_configure(
@@ -141,6 +183,7 @@ void WallpaperSurface::updateBuffer() {
if (QtWayland::wp_viewport::isInitialized())
set_destination(m_size.width(), m_size.height());
requestFrame();
m_service->queue(this);
}