Skip to content

Commit 6507f27

Browse files
committed
适配 macOS 壁纸
1 parent 5e2d3e9 commit 6507f27

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/main/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ app.whenReady().then(async () => {
6464
});
6565
app.quit();
6666
}
67-
}
68-
const settings = await getSettings();
69-
if (settings.createDesktopShortcut) {
70-
createShortcuts();
67+
const settings = await getSettings();
68+
if (settings.createDesktopShortcut) {
69+
createShortcuts();
70+
}
7171
}
7272
});
7373

src/main/utils/windowManager.ts

+7
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ class WindowManager {
5151
if (this.wallpaperWindow && !this.wallpaperWindow.isDestroyed()) {
5252
return this.wallpaperWindow;
5353
}
54+
const screenSize = screen.getPrimaryDisplay().size;
5455
this.wallpaperWindow = this.createWindow('wallpaper', {
5556
fullscreen: process.platform === 'win32',
57+
height: screenSize.height,
58+
width: screenSize.width,
59+
titleBarStyle: 'customButtonsOnHover',
60+
hasShadow: true,
61+
roundedCorners: false,
62+
type: 'desktop'
5663
});
5764
this.wallpaperWindow.on('closed', () => {
5865
this.wallpaperWindow = undefined;

0 commit comments

Comments
 (0)