Skip to content

Commit

Permalink
Set the default DPI awareness for Zed (#8936)
Browse files Browse the repository at this point in the history
### Description

This is a part of #8809 


Release Notes:
- N/A
  • Loading branch information
JunkuiZhang authored Mar 6, 2024
1 parent 59faef5 commit 8357039
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/zed/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
}
8 changes: 8 additions & 0 deletions crates/zed/resources/windows/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

0 comments on commit 8357039

Please sign in to comment.