Includes prior-session patches (carry forward so the app compiles): - crates/gpui/build.rs: cross-compile manifest fix - crates/gpui/src/platform.rs: PlatformWindow::activate_with_token trait method - crates/gpui/src/window.rs: Window::activate_with_token public API - crates/gpui_linux/src/linux/wayland/window.rs: WaylandWindow::activate_with_token + activate() keyboard-serial fix Plus the focus-serial fix: - serial.rs: SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; latest_serial_of() 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();
|
|
}
|