From 8f2fe0c1e08a7a76997e126ce82ef19ad8949db5 Mon Sep 17 00:00:00 2001 From: Tryanks Date: Sun, 6 Dec 2026 19:53:56 +0800 Subject: [PATCH] Windows: tcode.exe embeds the application manifest GPUI needs, so it starts again Since gpui-base 0.12 dropped gpui-pre from the desktop build (e63840749), nothing embedded a manifest: gpui-base and gpui-kit turn on gpui-fast's windows-manifest-provided-by-host, and Tcode's resource script carried only the icon. Without the Common-Controls v6 dependency the loader binds comctl32 v5, which has no TaskDialogIndirect, and v0.5.4 and v0.5.5 refuse to start. The manifest is GPUI's own, so per-monitor DPI awareness returns too, and the build now fails instead of shipping an exe without it. --- assets/icons/app/tcode.manifest.xml | 33 +++++++++++++++++++++++++++++ assets/icons/app/tcode.rc | 1 + crates/app/build.rs | 9 ++++++-- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 assets/icons/app/tcode.manifest.xml diff --git a/assets/icons/app/tcode.manifest.xml b/assets/icons/app/tcode.manifest.xml new file mode 100644 index 000000000..d11e1a4b4 --- /dev/null +++ b/assets/icons/app/tcode.manifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + true/pm + PerMonitorV2 + SegmentHeap + + + + + + + + diff --git a/assets/icons/app/tcode.rc b/assets/icons/app/tcode.rc index 71c59ae09..adfb46432 100644 --- a/assets/icons/app/tcode.rc +++ b/assets/icons/app/tcode.rc @@ -1 +1,2 @@ 1 ICON "tcode.ico" +1 24 "tcode.manifest.xml" diff --git a/crates/app/build.rs b/crates/app/build.rs index a01a731ed..dd439fe68 100644 --- a/crates/app/build.rs +++ b/crates/app/build.rs @@ -14,6 +14,7 @@ fn main() { println!("cargo:rerun-if-changed=../../assets/icons/app/tcode.rc"); println!("cargo:rerun-if-changed=../../assets/icons/app/tcode.ico"); + println!("cargo:rerun-if-changed=../../assets/icons/app/tcode.manifest.xml"); if std::env::var_os("CARGO_CFG_WINDOWS").is_some() { // GPUI requests, prepaints and paints the element tree recursively on @@ -24,12 +25,16 @@ fn main() { if std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc") { println!("cargo:rustc-link-arg-bins=/STACK:{}", 8 * 1024 * 1024); } + // gpui-base and gpui-kit turn on gpui-fast's + // `windows-manifest-provided-by-host`, so the manifest GPUI needs + // (Common-Controls v6 for TaskDialogIndirect, per-monitor DPI) is ours + // to embed; without it the loader refuses to start tcode.exe. embed_resource::compile_for( "../../assets/icons/app/tcode.rc", ["tcode"], embed_resource::NONE, ) - .manifest_optional() - .expect("failed to embed the Tcode application icon"); + .manifest_required() + .expect("failed to embed the Tcode application icon and manifest"); } }