Merge pull request #8 from youngYangtze/fix/pet-visible-on-all-spaces

fix(desktop): show pet window on all macOS Spaces
This commit is contained in:
Alvin 2026-05-10 17:43:15 +02:00 • committed by GitHub
commit d9af007f48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -194,6 +194,13 @@ function createBasePetWindow(title: string, position: Point): BrowserWindow {
window.setMenu(null);
window.setAlwaysOnTop(true, "floating");
// Show the pet window on all macOS Spaces (desktop workspaces).
// Without this, the window is bound to the Space where it was created
// and disappears when the user switches to another Space.
if (process.platform === "darwin") {
window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
}
window.webContents.setWindowOpenHandler(() => ({ action: "deny" }));
window.webContents.on("will-navigate", (event, url) => {
if (isAllowedPetDocumentUrl(url)) return;