From c91950c70f0e25037d5dcd3a93ae817d7f77c8de Mon Sep 17 00:00:00 2001 From: Eknight-Eutopia <2715417602@qq.com> Date: Wed, 27 May 2026 00:27:01 +0800 Subject: [PATCH 1/3] fix custom wallpaper_exe path and workshop_path logic --- apps/we-gui/src/main.rs | 18 ++++++++++------ crates/we-core/src/config.rs | 10 ++++++--- crates/we-core/src/steam.rs | 42 +++++++++++++++++++++--------------- 3 files changed, 44 insertions(+), 26 deletions(-) diff --git a/apps/we-gui/src/main.rs b/apps/we-gui/src/main.rs index 1748684..cb4afcb 100644 --- a/apps/we-gui/src/main.rs +++ b/apps/we-gui/src/main.rs @@ -16,7 +16,10 @@ use settings_panel::{ ResolutionOption, UiSettings, }; use we_core::{ - config::{build_config, load_launch_settings, save_config, CgroupMode, LaunchSettings, WindowsLauncher}, + config::{ + build_config, load_launch_settings, save_config, CgroupMode, LaunchSettings, + WindowsLauncher, + }, steam::{self, WallpaperEngineInstallState}, wallpaper::{self, WallpaperEntry, WallpaperType}, }; @@ -486,7 +489,8 @@ impl App { steam::default_config_path().unwrap_or_else(|| PathBuf::from("config.toml")); let mut launch_settings = load_launch_settings(&config_path).unwrap_or_else(|_| LaunchSettings::default()); - let install_state = steam::detect_wallpaper_engine_install_state(); + let install_state = + steam::detect_wallpaper_engine_install_state(launch_settings.wallpaper_exe.clone()); let install_notice = match &install_state { WallpaperEngineInstallState::NotInstalled => Some( "Wallpaper Engine is not installed. Please install it, or choose paths in Settings." @@ -503,9 +507,11 @@ impl App { None } }; - let workshop_path = steam::discover_workshop_wallpaper_root() - .map(|p| p.display().to_string()) - .unwrap_or_default(); + if launch_settings.workshop_path.trim().is_empty() { + launch_settings.workshop_path = steam::discover_workshop_wallpaper_root() + .map(|p| p.display().to_string()) + .unwrap_or_default(); + } let supported_resolutions = detect_supported_resolutions(); let wine_commands = steam::discover_wine_commands() .into_iter() @@ -529,7 +535,7 @@ impl App { let ui_settings = UiSettings { wallpaper_exe: launch_settings.wallpaper_exe.clone(), executable_variant: infer_executable_variant(&launch_settings.wallpaper_exe), - workshop_path, + workshop_path: launch_settings.workshop_path.clone(), launcher_mode: match launch_settings.launcher { WindowsLauncher::Wine => LauncherModeOption::Wine, WindowsLauncher::Proton => LauncherModeOption::Proton, diff --git a/crates/we-core/src/config.rs b/crates/we-core/src/config.rs index adbf5a3..f0baa27 100644 --- a/crates/we-core/src/config.rs +++ b/crates/we-core/src/config.rs @@ -52,6 +52,7 @@ pub struct WineConfig { #[serde(default)] pub command_mode: WineCommandMode, pub wallpaper_exe: String, + pub workshop_path: String, pub args: Vec, #[serde(default)] pub env: BTreeMap, @@ -122,6 +123,7 @@ pub enum CgroupMode { #[derive(Debug, Clone)] pub struct LaunchSettings { pub wallpaper_exe: String, + pub workshop_path: String, pub launcher: WindowsLauncher, pub wine_command: String, pub proton_path: Option, @@ -147,6 +149,7 @@ impl Default for LaunchSettings { fn default() -> Self { Self { wallpaper_exe: String::new(), + workshop_path: String::new(), launcher: WindowsLauncher::Wine, wine_command: "wine".to_string(), proton_path: None, @@ -217,6 +220,7 @@ impl Default for AppConfig { command: "wine".to_string(), command_mode: WineCommandMode::ExeWithArgs, wallpaper_exe: String::new(), + workshop_path: String::new(), args: Vec::new(), env: BTreeMap::new(), }, @@ -427,7 +431,6 @@ pub fn load_launch_settings(path: &Path) -> Result { let cfg: AppConfig = toml::from_str(&raw).with_context(|| format!("invalid TOML in {}", path.display()))?; let mut settings = LaunchSettings::default(); - settings.fps_limit = cfg.general.fps_limit; settings.show_fps = cfg.general.show_fps; settings.hide_debug_window = cfg.general.hide_debug_window; @@ -443,6 +446,8 @@ pub fn load_launch_settings(path: &Path) -> Result { settings.cgroup_cpu_max = cfg.cgroup.cpu_max; settings.wallpaper_exe = cfg.wine.wallpaper_exe; + settings.workshop_path = cfg.wine.workshop_path; + match cfg.wine.command_mode { WineCommandMode::ExeWithArgs => { settings.launcher = WindowsLauncher::Wine; @@ -458,8 +463,7 @@ pub fn load_launch_settings(path: &Path) -> Result { if let Some(width) = arg_value(&cfg.wine.args, "-width").and_then(|v| v.parse::().ok()) { settings.width = width.max(1); } - if let Some(height) = arg_value(&cfg.wine.args, "-height").and_then(|v| v.parse::().ok()) - { + if let Some(height) = arg_value(&cfg.wine.args, "-height").and_then(|v| v.parse::().ok()) { settings.height = height.max(1); } if let Some(x) = arg_value(&cfg.wine.args, "-x").and_then(|v| v.parse::().ok()) { diff --git a/crates/we-core/src/steam.rs b/crates/we-core/src/steam.rs index fb5f54c..fb54405 100644 --- a/crates/we-core/src/steam.rs +++ b/crates/we-core/src/steam.rs @@ -41,28 +41,36 @@ pub fn discover_wallpaper_engine_exe() -> Option { None } -pub fn detect_wallpaper_engine_install_state() -> WallpaperEngineInstallState { - for root in steam_common_roots() { - let app_dir = root.join("wallpaper_engine"); - if !app_dir.is_dir() { - continue; - } +pub fn detect_wallpaper_engine_install_state(wallpaper_exe: String) -> WallpaperEngineInstallState { + if wallpaper_exe.trim().is_empty() { + for root in steam_common_roots() { + let app_dir = root.join("wallpaper_engine"); + if !app_dir.is_dir() { + continue; + } - let exe64 = app_dir.join("wallpaper64.exe"); - if exe64.is_file() { - return WallpaperEngineInstallState::Installed { app_dir, exe_path: exe64 }; - } + let exe64 = app_dir.join("wallpaper64.exe"); + if exe64.is_file() { + return WallpaperEngineInstallState::Installed { app_dir, exe_path: exe64 }; + } - let exe32 = app_dir.join("wallpaper32.exe"); - if exe32.is_file() { - return WallpaperEngineInstallState::Installed { app_dir, exe_path: exe32 }; - } + let exe32 = app_dir.join("wallpaper32.exe"); + if exe32.is_file() { + return WallpaperEngineInstallState::Installed { app_dir, exe_path: exe32 }; + } - if app_dir.join("installer.exe").is_file() { - return WallpaperEngineInstallState::FirstRunRequired { app_dir }; + if app_dir.join("installer.exe").is_file() { + return WallpaperEngineInstallState::FirstRunRequired { app_dir }; + } + } + } else { + let exe64 = PathBuf::from(wallpaper_exe); + let mut app_dir = exe64.clone(); + app_dir.pop(); + if exe64.is_file() && exe64.ends_with("wallpaper64.exe") { + return WallpaperEngineInstallState::Installed { app_dir, exe_path: exe64 }; } } - WallpaperEngineInstallState::NotInstalled } From 465b90a85d34200ff6d9591e9af69cf5ec279383 Mon Sep 17 00:00:00 2001 From: Eknight-Eutopia <2715417602@qq.com> Date: Wed, 27 May 2026 23:30:44 +0800 Subject: [PATCH 2/3] fix workshop_path pesistent logic --- crates/we-core/src/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/we-core/src/config.rs b/crates/we-core/src/config.rs index f0baa27..ae70286 100644 --- a/crates/we-core/src/config.rs +++ b/crates/we-core/src/config.rs @@ -251,6 +251,7 @@ pub fn build_config( cfg.wine.command = settings.wine_command.clone(); cfg.wine.command_mode = WineCommandMode::ExeWithArgs; cfg.wine.wallpaper_exe = settings.wallpaper_exe.clone(); + cfg.wine.workshop_path = settings.workshop_path.clone(); cfg.wine.env.clear(); cfg.capture.wm_class_contains = settings.wm_class_contains.clone(); cfg.capture.title_contains = settings.play_in_window_title.clone(); From 4240dcc59bc974913ebeaf6a109f1c110f49611f Mon Sep 17 00:00:00 2001 From: Eknight-Eutopia <2715417602@qq.com> Date: Thu, 28 May 2026 00:09:54 +0800 Subject: [PATCH 3/3] fix compat_data_path --- crates/we-core/src/config.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/we-core/src/config.rs b/crates/we-core/src/config.rs index ae70286..67f3e82 100644 --- a/crates/we-core/src/config.rs +++ b/crates/we-core/src/config.rs @@ -379,9 +379,13 @@ pub fn build_config( "STEAM_COMPAT_CLIENT_INSTALL_PATH".to_string(), steam_root.display().to_string(), ); + } + if let Some(wallpaper_root) = + derive_steam_root_from_proton_path(exe_path.to_str().unwrap()) + { cfg.wine.env.insert( "STEAM_COMPAT_DATA_PATH".to_string(), - steam_root + wallpaper_root .join("steamapps") .join("compatdata") .join(WALLPAPER_ENGINE_APP_ID.to_string())