From 835703941951267e751476d59ae00b6ce655963f Mon Sep 17 00:00:00 2001 From: Small White <364772080@qq.com> Date: Thu, 7 Mar 2024 03:45:18 +0800 Subject: [PATCH] Set the default DPI awareness for Zed (#8936) ### Description This is a part of #8809 Release Notes: - N/A --- crates/zed/build.rs | 11 ++++++++++- crates/zed/resources/windows/manifest.xml | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 crates/zed/resources/windows/manifest.xml diff --git a/crates/zed/build.rs b/crates/zed/build.rs index daea199e21..783995942f 100644 --- a/crates/zed/build.rs +++ b/crates/zed/build.rs @@ -44,8 +44,17 @@ fn main() { } } - // todo!("windows"): This is to avoid stack overflow. Remove it when solved. if std::env::var("CARGO_CFG_TARGET_ENV").ok() == Some("msvc".to_string()) { + // todo!("windows"): This is to avoid stack overflow. Remove it when solved. println!("cargo:rustc-link-arg=/stack:{}", 8 * 1024 * 1024); + + let manifest = std::path::Path::new("resources/windows/manifest.xml"); + println!("cargo:rerun-if-changed={}", manifest.display()); + println!("cargo:rustc-link-arg-bins=/MANIFEST:EMBED"); + + println!( + "cargo:rustc-link-arg-bins=/MANIFESTINPUT:{}", + manifest.canonicalize().unwrap().display() + ); } } diff --git a/crates/zed/resources/windows/manifest.xml b/crates/zed/resources/windows/manifest.xml new file mode 100644 index 0000000000..a2276d35ca --- /dev/null +++ b/crates/zed/resources/windows/manifest.xml @@ -0,0 +1,8 @@ + + + + true + PerMonitorV2 + + +