From 55d6972f50196b766bdcfde73bd9cb59b195da31 Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Fri, 19 Jun 2026 18:06:48 +0800 Subject: [PATCH] fix(host): op-app opts into gl-host on desktop to keep native host API Phase 0 follow-up. With op-host-native's gl-host now NON-default (approach Y), op-app's plain dependency re-exported only the raster host, dropping host_native::WidgetHostNative on desktop too (codex stop-review). Add a desktop-only (macos/linux/windows) op-host-native edge with features=[gl-host] so the documented native host API is present on desktop; the non-wasm base edge (no gl-host) keeps iOS/Android raster. Verified: op-app builds; cargo tree shows gl-host on desktop; a compile-check confirms op_app::host_native::WidgetHostNative + CursorHint resolve. --- crates/op-app/Cargo.toml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/op-app/Cargo.toml b/crates/op-app/Cargo.toml index 8553cd99e..712fe88c5 100644 --- a/crates/op-app/Cargo.toml +++ b/crates/op-app/Cargo.toml @@ -22,12 +22,21 @@ path = "src/lib.rs" [dependencies] op-editor-ui = { path = "../op-editor-ui" } -# Native host (winit + skia-safe + accesskit) — desktop + mobile, NOT -# wasm. Mirrors op-host-native's own target gate so op-app stays -# wasm32-clean and mobile-checkable. +# Native host — every non-wasm target incl. iOS / Android. Base edge WITHOUT +# `gl-host`, so the mobile cargo-check stays raster (no winit/glutin/skia-gl), +# matching op-host-native's own non-default gl-host (Phase 0 approach Y). [target.'cfg(not(target_arch = "wasm32"))'.dependencies] op-host-native = { path = "../op-host-native", version = "0.8.0" } +# Desktop adds the interactive GL host: `gl-host` brings winit + skia-safe `gl` +# + `WidgetHostNative`, so `host_native::WidgetHostNative` (the documented native +# host API) is available on macOS / Linux / Windows. Cargo unifies this with the +# base edge above into one op-host-native with gl-host on desktop; mobile keeps +# the raster base. (The shipped desktop binary is op-host-desktop, which depends +# on op-host-native with gl-host directly.) +[target.'cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))'.dependencies] +op-host-native = { path = "../op-host-native", version = "0.8.0", features = ["gl-host"] } + # Web host (wasm32-unknown-unknown bundle entry). Only resolved on # the wasm32 target where op-host-web's cdylib / wasm-bindgen setup # applies.