thundernet8 / StarCabinet

:tada: 开源的跨平台Github Stars管理分析工具
MIT License
409 stars 49 forks source link

单个实例窗口 #3

Closed thundernet8 closed 7 years ago

thundernet8 commented 7 years ago
thundernet8 commented 7 years ago
// Make app single instance
let shouldQuit = app.makeSingleInstance(function (commandLine, workingDirectory) {
  // Someone tried to run a second instance, we should focus our window.
  if (win.login) {
    win.login.focus()
  }
  if (win.main) {
    if (win.main.isMinimized()) win.main.restore()
    win.main.focus()
  }
})