Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ members = [
exclude = [
"OpenBitFun-Installer/src-tauri",
"third_party/eioc",
"third_party/tao",
]

resolver = "2"
Expand Down Expand Up @@ -302,6 +303,9 @@ rustls = { version = "0.23", default-features = false }
[patch.crates-io]
# Keep Socket.IO on the product-owned ring provider; see the patch note.
eioc = { path = "third_party/eioc" }
# Restore macOS traffic-light geometry after the queued native style reset.
# See third_party/tao/OPENBITFUN-PATCH.md for the upstream source and removal condition.
tao = { path = "third_party/tao" }
# Tauri 2.11 loses keyboard focus for child webviews after Windows reactivates
# an `unstable` multi-webview window. Use the upstream fix until released;
# this revision also adopts tao 0.36, which includes the Windows input deadlock fix.
Expand Down
19 changes: 19 additions & 0 deletions scripts/check-core-boundaries.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4850,6 +4850,25 @@ test('vendored Engine.IO remains in resolved feature audits without becoming a p
'a product workspace member cannot bypass ownership checks through a vendor path');
});

test('vendored Tao is external only at its reviewed version and stays in feature audits', () => {
const owner = packageAt('owner', 'src/apps/example/Cargo.toml');
const vendor = { ...packageAt('tao', 'third_party/tao/Cargo.toml'), version: '0.36.0' };
const collect = (pkg = vendor, members = [owner.id]) => collectCargoMetadataGraph({
root: TEST_ROOT,
manifestPaths: [join(TEST_ROOT, 'Cargo.toml')],
loadMetadata: () => ({
packages: [owner, pkg], workspace_members: members,
resolve: { nodes: [{ id: pkg.id, features: ['rwh_06'], deps: [] }] },
}),
});
const graph = collect();
assert.deepEqual(graph.packages.map(pkg => pkg.name), ['owner']);
assert.ok(graph.resolvedPackageFeatures.some(record => record.name === 'tao'));
assert.ok(collect(vendor, [owner.id, vendor.id]).packages.some(pkg => pkg.name === 'tao'));
assert.ok(collect({ ...vendor, version: '0.37.0' }).packages.some(pkg => pkg.name === 'tao'));
assert.ok(collect({ ...vendor, name: 'product-owner' }).packages.some(pkg => pkg.name === 'product-owner'));
});


test('workspace transfer admits IO without process or networking capabilities', () => {
const pkg = {
Expand Down
17 changes: 11 additions & 6 deletions scripts/core-boundaries/cargo-dependency-boundaries.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ function repositoryPath(root, path) {
return result;
}

// This crates.io source is patched only to select the product TLS provider.
// It is an external dependency, not an OpenBitFun runtime owner. Resolved
// feature checks below still include it and its full dependency closure.
// Reviewed crates.io copies remain external dependencies, not product owners.
// Resolved feature checks still include them and their full dependency closure.
const VENDORED_EXTERNAL_PACKAGES = new Map([
['third_party/eioc/Cargo.toml', { name: 'eioc', version: '0.5.0' }],
['third_party/tao/Cargo.toml', { name: 'tao', version: '0.36.0' }],
]);

function isVendoredExternalManifest(root, manifestPath) {
return repositoryPath(root, manifestPath) === 'third_party/eioc/Cargo.toml';
return VENDORED_EXTERNAL_PACKAGES.has(repositoryPath(root, manifestPath));
}

function layerForManifest(manifestPath, { root, crateLayoutRules }) {
Expand Down Expand Up @@ -2667,8 +2671,9 @@ export function collectCargoMetadataGraph({
continue;
}
const packageManifestKey = normalizedPath(pkg.manifest_path);
if (isVendoredExternalManifest(root, pkg.manifest_path)
&& pkg.name === 'eioc' && pkg.version === '0.5.0' && !workspaceMemberIds.has(pkg.id)) {
const vendor = VENDORED_EXTERNAL_PACKAGES.get(repositoryPath(root, pkg.manifest_path));
if (vendor && pkg.name === vendor.name && pkg.version === vendor.version
&& !workspaceMemberIds.has(pkg.id)) {
continue;
}
if (workspaceMemberIds.has(pkg.id)) {
Expand Down
5 changes: 3 additions & 2 deletions src/apps/desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ dispatch = { workspace = true }
foreign-types = { workspace = true }
libc = { workspace = true }
objc2 = { workspace = true, features = ["exception"] }
objc2-foundation = { workspace = true, features = ["std", "NSArray", "NSData", "NSDictionary", "NSError", "NSString"] }
objc2-app-kit = { workspace = true, features = ["std", "libc", "NSWorkspace", "NSRunningApplication"] }
block2 = { workspace = true }
objc2-foundation = { workspace = true, features = ["std", "NSArray", "NSData", "NSDictionary", "NSError", "NSGeometry", "NSNotification", "NSOperation", "NSString", "block2"] }
objc2-app-kit = { workspace = true, features = ["std", "libc", "NSAnimationContext", "NSButton", "NSControl", "NSResponder", "NSView", "NSWindow", "NSWorkspace", "NSRunningApplication"] }
objc2-vision = { workspace = true, features = ["std", "VNRecognizeTextRequest", "VNRequest", "VNObservation", "VNRequestHandler", "VNUtils", "VNTypes", "objc2-core-foundation"] }

[target.'cfg(windows)'.dependencies]
Expand Down
21 changes: 12 additions & 9 deletions src/apps/desktop/src/appearance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,20 +553,15 @@ pub fn create_main_window(
let materialization_workbench = Arc::clone(&frontend_workbench);
#[cfg(target_os = "macos")]
let builder = {
// Configure both Tao's native window and Wry's WebView. The builder's
// traffic_light_position setter only configures Wry, so native window
// lifecycle events otherwise restore the default button placement.
// Configure the native window as well as its WebView. The WebView-only
// builder setter misses Tao's title/resize/fullscreen restoration path.
// Both framework paths receive one inset derived from AppKit metrics.
let config = tauri::utils::config::WindowConfig {
label: "main".into(),
url: main_url,
title_bar_style: tauri::TitleBarStyle::Overlay,
hidden_title: true,
// Native button center = inset + height / 2 - origin.y.
// AppKit's 16pt button at y=6 needs 20.5 for the 45px toolbar.
traffic_light_position: Some(tauri::utils::config::LogicalPosition {
x: 12.0,
y: 20.5,
}),
traffic_light_position: crate::macos_window_chrome::traffic_light_position(),
..Default::default()
};
match tauri::WebviewWindowBuilder::from_config(app_handle, &config) {
Expand Down Expand Up @@ -596,6 +591,10 @@ pub fn create_main_window(
.on_page_load({
let startup_trace_id = startup_trace_id.to_string();
move |_window, payload| {
#[cfg(target_os = "macos")]
if matches!(payload.event(), PageLoadEvent::Started) {
crate::macos_window_chrome::reset_renderer(_window.app_handle());
}
if matches!(payload.event(), PageLoadEvent::Finished) {
let _ = startup_page_ready.send(true);
}
Expand Down Expand Up @@ -678,6 +677,10 @@ pub fn create_main_window(
let build_started_at = Instant::now();
match builder.build() {
Ok(window) => {
#[cfg(target_os = "macos")]
if let Err(error) = crate::macos_window_chrome::install(&window) {
error!("Failed to install native fullscreen chrome synchronization: {error}");
}
#[cfg(target_os = "windows")]
if let Err(error) = crate::window_webview_geometry::install(&window) {
error!("Failed to install main WebView geometry protection: {error}");
Expand Down
2 changes: 2 additions & 0 deletions src/apps/desktop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ mod embedded_relay_host;
pub mod frontend_workbench;
pub mod logging;
pub mod macos_menubar;
#[cfg(target_os = "macos")]
mod macos_window_chrome;
mod openbitfun_control_host;
pub mod runtime;
pub mod sleep_prevention;
Expand Down
Loading
Loading