Rebuilt from the exact zed-industries/zed @ 8c74db00c4053d6c0a9037863d7bd048658da4ca tree (previous orphan was based on a stale/wrong fetch). Same 3-file patch: - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
35 lines
1.3 KiB
Rust
35 lines
1.3 KiB
Rust
#![allow(clippy::disallowed_methods, reason = "build scripts are exempt")]
|
|
|
|
fn main() {
|
|
println!("cargo::rustc-check-cfg=cfg(gles)");
|
|
|
|
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
|
|
|
if target_os == "windows" {
|
|
#[cfg(feature = "windows-manifest")]
|
|
embed_resource();
|
|
}
|
|
}
|
|
|
|
#[cfg(feature = "windows-manifest")]
|
|
fn embed_resource() {
|
|
let crate_dir = std::path::PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
|
|
let manifest = crate_dir.join("resources/windows/gpui.manifest.xml");
|
|
println!("cargo:rerun-if-changed={}", manifest.display());
|
|
|
|
let out_dir = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
|
|
|
|
// Copy resources to OUT_DIR so relative paths work during cross-compilation
|
|
let manifest_out = out_dir.join("gpui.manifest.xml");
|
|
std::fs::copy(&manifest, &manifest_out).expect("Failed to copy manifest file");
|
|
|
|
// Create RC file with relative path to copied manifest
|
|
let fixed_rc = out_dir.join("gpui-fixed.rc");
|
|
let rc_content = "#define RT_MANIFEST 24\n1 RT_MANIFEST \"gpui.manifest.xml\"";
|
|
std::fs::write(&fixed_rc, rc_content).unwrap();
|
|
|
|
embed_resource::compile(&fixed_rc, embed_resource::NONE)
|
|
.manifest_required()
|
|
.unwrap();
|
|
}
|