From 956c7399405dcdb86e5e1ee60f644c3660644a33 Mon Sep 17 00:00:00 2001 From: Samuel Onoja Date: Sat, 26 Sep 2026 05:22:38 +0100 Subject: [PATCH] Optimize shell startup and include demo artwork --- README.md | 12 +++++++++--- shell/ferese-shell/Cargo.toml | 4 ++-- shell/ferese-shell/src/main.rs | 10 +++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 24e9cb0..efabb7f 100644 --- a/README.md +++ b/README.md @@ -159,9 +159,9 @@ The shell provides an edge-to-edge libcosmic menu bar backed by the private shell-control connection. Build and preview it nested with: ```bash -cargo build -p ferese -p ferese-shell -target/debug/ferese --backend nested --grant-effects --grant-shell-control -- \ - target/debug/ferese-shell +cargo build --release -p ferese -p ferese-shell +target/release/ferese --backend nested --grant-effects --grant-shell-control -- \ + target/release/ferese-shell ``` The Ferese mark enters overview, where workspace indicators become available. @@ -171,6 +171,12 @@ shadow. Window spacing uses the workspace outer gap; `top_bar_window_gap` under `[theme.geometry]` adds optional extra space (default 0). Solid and translucent shell surfaces also omit outlines. The dark startup fallback matches the material palette. +The shell decodes wallpaper in parallel with startup and prefers the lightweight +software renderer, with GPU rendering available as a fallback. Glass effects +still run on the compositor GPU. Set `ICED_BACKEND=wgpu` to explicitly use GPU +rendering for shell content. Use release builds when evaluating startup and +animation performance; debug image processing is considerably slower. + Keyboard and direct-session touchpad settings are applied at startup: ```toml diff --git a/shell/ferese-shell/Cargo.toml b/shell/ferese-shell/Cargo.toml index 2a18c84..6f44e7a 100644 --- a/shell/ferese-shell/Cargo.toml +++ b/shell/ferese-shell/Cargo.toml @@ -8,8 +8,8 @@ rust-version = "1.93" [dependencies] ferese-protocols = { path = "../../crates/ferese-protocols", default-features = false, features = ["client"] } jiff.workspace = true -# Wallpaper resampling must not block the bar on iced's shared UI thread. -# Keep tiny-skia available as libcosmic's fallback, but prefer GPU rendering. +# Keep GPU rendering available as a fallback/override. The shell defaults to +# tiny-skia to avoid a second GPU initialization during desktop startup. libcosmic = { workspace = true, features = ["wgpu"] } serde.workspace = true toml.workspace = true diff --git a/shell/ferese-shell/src/main.rs b/shell/ferese-shell/src/main.rs index e513d0a..464074e 100644 --- a/shell/ferese-shell/src/main.rs +++ b/shell/ferese-shell/src/main.rs @@ -79,6 +79,13 @@ impl From for BarMetrics { } fn main() -> cosmic::iced::Result { + // Small shell surfaces do not need a second GPU device and shader setup. + // Keep wgpu as a fallback and honor an explicit renderer preference. + if std::env::var_os("ICED_BACKEND").is_none() { + // SAFETY: this is the process entry point, before any worker or + // toolkit threads are started. + unsafe { std::env::set_var("ICED_BACKEND", "tiny-skia,wgpu") }; + } let config = config::load(); // Decode alongside toolkit/GPU initialization, never during a UI draw. let wallpaper = config.wallpaper.path.clone().map(|path| { @@ -227,7 +234,8 @@ impl cosmic::Application for FereseShell { Some(Box::new(Self::view_layer)), ); - let tasks = [wallpaper_action, bar_action] + // Submit the small interactive surface before the full-screen image. + let tasks = [bar_action, wallpaper_action] .map(cosmic::Action::Surface) .map(cosmic::task::message);