diff --git a/Cargo.lock b/Cargo.lock index de51d3f..2f6d86c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1965,6 +1965,7 @@ dependencies = [ "fluent-core", "fluent-layout", "gpui", + "gpui_platform", ] [[package]] @@ -2009,6 +2010,7 @@ version = "0.1.0" dependencies = [ "fluent-core", "gpui", + "gpui_platform", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b114892..a613f10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,7 @@ members = [ [workspace.dependencies] gpui = { path = "vendor/zed/crates/gpui", version = "0.2" } +gpui_platform = { path = "vendor/zed/crates/gpui_platform", version = "0.1" } fluent-core = { path = "crates/fluent-core", version = "2.4.0" } fluent-primitives = { path = "crates/fluent-primitives", version = "2.4.0" } diff --git a/crates/fluent-app/Cargo.toml b/crates/fluent-app/Cargo.toml index 1cf5fcf..00677f1 100644 --- a/crates/fluent-app/Cargo.toml +++ b/crates/fluent-app/Cargo.toml @@ -10,5 +10,6 @@ categories = ["gui"] [dependencies] gpui = { workspace = true } +gpui_platform = { workspace = true } fluent-core = { workspace = true } fluent-layout = { workspace = true } diff --git a/crates/fluent-app/src/app_builder.rs b/crates/fluent-app/src/app_builder.rs index a12ec9a..1c3a100 100644 --- a/crates/fluent-app/src/app_builder.rs +++ b/crates/fluent-app/src/app_builder.rs @@ -3,8 +3,8 @@ use std::sync::Arc; use fluent_core::Theme; use fluent_layout::{modal::ModalStack, ToastStack}; use gpui::{ - prelude::*, px, size, App, Application, AssetSource, Bounds, Context, Entity, IntoElement, - Render, SharedString, TitlebarOptions, Window, WindowBounds, WindowDecorations, WindowOptions, + prelude::*, px, size, App, AssetSource, Bounds, Context, Entity, IntoElement, Render, + SharedString, TitlebarOptions, Window, WindowBounds, WindowDecorations, WindowOptions, }; use crate::{ @@ -159,7 +159,7 @@ impl FluentApp { let dark = self.dark; let assets = self.assets; - Application::new() + gpui_platform::application() .with_assets(FluentAssets::new(assets)) .run(move |cx: &mut App| { if dark { diff --git a/crates/fluent-test-utils/Cargo.toml b/crates/fluent-test-utils/Cargo.toml index 7ba0da9..62ed7c2 100644 --- a/crates/fluent-test-utils/Cargo.toml +++ b/crates/fluent-test-utils/Cargo.toml @@ -5,4 +5,5 @@ edition = "2021" [dependencies] gpui = { workspace = true, features = ["test-support"] } +gpui_platform = { workspace = true } fluent-core = { workspace = true } diff --git a/crates/fluent-test-utils/src/lib.rs b/crates/fluent-test-utils/src/lib.rs index f273ff0..07b5e38 100644 --- a/crates/fluent-test-utils/src/lib.rs +++ b/crates/fluent-test-utils/src/lib.rs @@ -2,6 +2,13 @@ use fluent_core::Theme; pub use gpui::{Context, Entity, TestAppContext, VisualTestContext, Window}; +/// Build the GPUI application the way the ported crates do: the native platform +/// comes from `gpui_platform`, not `gpui::Application::new`, which the vendored +/// gpui no longer provides. +pub fn application() -> gpui::Application { + gpui_platform::application() +} + pub fn init_fluent_test(cx: &mut TestAppContext) { cx.update(Theme::init); }