escrcpy/electron/events/app/index.js
2024-09-12 19:11:46 +08:00

20 lines
419 B
JavaScript

import { app, BrowserWindow, ipcMain } from 'electron'
export default () => {
ipcMain.on('restart-app', () => {
app.isQuiting = true
app.relaunch()
app.quit()
})
ipcMain.on('close-active-window', (event) => {
const win = BrowserWindow.getFocusedWindow()
win.close()
})
ipcMain.on('hide-active-window', (event) => {
const win = BrowserWindow.getFocusedWindow()
win.hide()
})
}