Skip to content

Commit c3428b9

Browse files
author
Hiram
committed
[optimize] boss key for video logic issue #323
1 parent f8487ec commit c3428b9

File tree

3 files changed

+276
-171
lines changed

3 files changed

+276
-171
lines changed

src/main/utils/tool.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
import { BrowserWindow } from 'electron';
2+
import { getWin } from '../core/winManger';
23

34
const toggleWindowVisibility = () => {
45
const windows = BrowserWindow.getAllWindows();
56
if (windows.length === 0) return;
67
const anyVisible = windows.some((win) => win.isVisible());
78
windows.forEach((win) => {
89
if (!win.isDestroyed()) {
10+
const playWin = getWin('play');
911
if (anyVisible) {
1012
win.hide();
13+
if (playWin) {
14+
playWin.webContents.send('media-control', false);
15+
playWin.webContents.setAudioMuted(true);
16+
}
1117
} else {
1218
win.show();
19+
if (playWin) {
20+
playWin.webContents.send('media-control', true);
21+
playWin.webContents.setAudioMuted(false);
22+
playWin.focus();
23+
}
1324
}
1425
}
1526
});

0 commit comments

Comments
 (0)