R6.12 round 1 fix: the worker registers as a UI element

The worker set the accessory policy after AppKit had already registered it
as a Dock app, so 11 of 15 launches showed Foreground for about 30 ms.
Now it sets LSUIElement in its main bundle's info before the kernel starts
AppKit, and fails to start unless the policy came up as accessory.

tests/scripts/dock-macos.sh samples each worker's type from its start until
the first tile; on the Mac mini 30 launches were all UIElement, and the
shipped worker fails it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-15 19:45:48 -04:00
1 parent fdb8317d24
commit 1317c4ad39
6 files changed
+102 -30

No files matched your search

+3 -1
View File
@@ -84,7 +84,7 @@ impl Lok {
let lib = Library::open(install)?;
// Before the kit starts, so no Dock icon shows.
#[cfg(target_os = "macos")]
accessory::accessory(install)?;
accessory::hide()?;
let hook: Hook2 = unsafe {
lib.symbol(b"libreofficekit_hook_2\0")
.or_else(|_| lib.symbol(b"libreofficekit_hook\0"))
@@ -102,6 +102,8 @@ impl Lok {
"lok hook failed for {install_str}"
)));
}
#[cfg(target_os = "macos")]
accessory::check()?;
log::info!("lok: hooked {}", install_str);
Ok(Self { kit, _lib: lib })
}