Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/infra/runners/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pub mod r#trait;
pub mod wine_tkg;
pub mod proton_tkg;

pub use r#trait::*;
pub use wine_tkg::*;
pub use proton_tkg::*;

#[cfg(test)]
mod tests;
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use crate::infra::runners::{Runner, LaunchContext, CommandSpec};
use crate::steam_client::SteamClient;
use crate::launch::pipeline::{LaunchError, LaunchErrorKind};

pub struct WineTkgRunner;
pub struct ProtonTkgRunner;

#[async_trait::async_trait]
impl Runner for WineTkgRunner {
fn name(&self) -> &str { "Wine-TKG" }
impl Runner for ProtonTkgRunner {
fn name(&self) -> &str { "Proton-TKG" }
async fn prepare_prefix(&self, ctx: &LaunchContext) -> std::result::Result<(), LaunchError> {
let library_root = PathBuf::from(&ctx.launcher_config.steam_library_path);

Expand Down Expand Up @@ -362,6 +362,10 @@ impl Runner for WineTkgRunner {

async fn build_env(&self, ctx: &LaunchContext) -> std::result::Result<HashMap<String, String>, LaunchError> {
let mut env = HashMap::new();

// Disables Proton's native lsteamclient bridge to force the use of the Windows Steam Client.
env.insert("PROTON_DISABLE_LSTEAMCLIENT".to_string(), "1".to_string());

let app_id_str = ctx.app.app_id.to_string();

let library_root = PathBuf::from(&ctx.launcher_config.steam_library_path);
Expand Down
12 changes: 6 additions & 6 deletions src/infra/runners/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(test)]
mod tests {
use crate::infra::runners::{LaunchContext, CommandSpec, Runner, WineTkgRunner};
use crate::infra::runners::{LaunchContext, CommandSpec, Runner, ProtonTkgRunner};
use crate::models::LibraryGame;
use crate::steam_client::{LaunchInfo, LaunchTarget};
use crate::config::LauncherConfig;
Expand Down Expand Up @@ -56,8 +56,8 @@ mod tests {
}

#[tokio::test]
async fn test_wine_tkg_runner_graphics_policy_autodetect() {
use crate::infra::runners::wine_tkg::WineTkgRunner;
async fn test_proton_tkg_runner_graphics_policy_autodetect() {
use crate::infra::runners::proton_tkg::ProtonTkgRunner;
use crate::models::GraphicsBackendPolicy;
use crate::config::LauncherConfig;
use crate::steam_client::{LaunchInfo, LaunchTarget};
Expand Down Expand Up @@ -115,7 +115,7 @@ mod tests {
verification_ptr: std::ptr::null_mut(),
};

let runner = WineTkgRunner;
let runner = ProtonTkgRunner;
let env = runner.build_env(&ctx).await.unwrap();

// Auto is now CONSERVATIVE: it should NOT have enabled DXVK even if simulated on disk
Expand All @@ -135,9 +135,9 @@ mod tests {
}

#[tokio::test]
async fn test_wine_tkg_runner_stubs() {
async fn test_proton_tkg_runner_stubs() {
// We can only test stubs that don't hit the filesystem hard or expect real Proton/Wine
let runner = WineTkgRunner;
let runner = ProtonTkgRunner;
let ctx = mock_context();

// build_env should succeed without real filesystem
Expand Down
4 changes: 2 additions & 2 deletions src/launch/stages/resolve_components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Runner for NativeRunner {
impl PipelineStage for ResolveComponentsStage {
fn name(&self) -> &str { "ResolveComponents" }
async fn execute(&self, ctx: &mut PipelineContext) -> std::result::Result<(), LaunchError> {
use crate::infra::runners::WineTkgRunner;
use crate::infra::runners::ProtonTkgRunner;
use crate::steam_client::LaunchTarget;

if ctx.runner.is_none() {
Expand All @@ -61,7 +61,7 @@ impl PipelineStage for ResolveComponentsStage {
ctx.runner = Some(Box::new(NativeRunner));
}
LaunchTarget::WindowsProton => {
ctx.runner = Some(Box::new(WineTkgRunner));
ctx.runner = Some(Box::new(ProtonTkgRunner));
}
}
} else {
Expand Down
Loading