Optimize shell startup and include demo artwork
This commit is contained in:
1 parent
2f8ba908a5
commit
956c739940
3 files changed
+20
-6
No files matched your search
@@ -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
|
||||
|
||||
@@ -79,6 +79,13 @@ impl From<ShellTheme> 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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user