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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ assertMatch(
'macOS capsule should join all Spaces before showing without activation',
);

assertMatch(
macosNoActivateFunction,
/FULL_SCREEN_AUXILIARY[\s\S]*?1 << 8[\s\S]*?setCollectionBehavior[\s\S]*?orderFrontRegardless/,
'macOS capsule should join fullscreen Spaces as an auxiliary window before showing without activation',
);

for (const forbidden of ['window.show()', 'set_focus', 'NSApp.activate', 'makeKeyAndOrderFront']) {
if (executableMacosNoActivateFunction.includes(forbidden)) {
throw new Error(`macOS capsule no-activate path must not call ${forbidden}`);
Expand Down
7 changes: 7 additions & 0 deletions openless-all/app/src-tauri/src/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4507,6 +4507,13 @@ fn show_capsule_window_no_activate<R: tauri::Runtime>(
}

unsafe {
const NS_WINDOW_COLLECTION_BEHAVIOR_CAN_JOIN_ALL_SPACES: usize = 1 << 0;
const NS_WINDOW_COLLECTION_BEHAVIOR_FULL_SCREEN_AUXILIARY: usize = 1 << 8;
let behavior: usize = msg_send![ns_window, collectionBehavior];
let behavior = behavior
| NS_WINDOW_COLLECTION_BEHAVIOR_CAN_JOIN_ALL_SPACES
| NS_WINDOW_COLLECTION_BEHAVIOR_FULL_SCREEN_AUXILIARY;
let _: () = msg_send![ns_window, setCollectionBehavior: behavior];
let _: () = msg_send![ns_window, orderFrontRegardless];
}
true
Expand Down
Loading