restore focus to orignal window

This commit is contained in:
cupcakearmy 2021-05-28 21:05:12 +02:00
parent 53c16e7063
commit f1c0ab6dbb
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Restore focus to previous window when closing banner
- Responsive image
### Fixed

View File

@ -1,6 +1,6 @@
import { join } from 'path'
import os from 'os'
import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron'
import { app, BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron'
import dayjs from 'dayjs'
import logger from 'electron-log'
import ms from 'ms'
@ -64,6 +64,9 @@ export default class Banner {
static close() {
if (this.window) {
Settings.save('lastRun', Date.now())
this.window.minimize()
this.window.hide()
if (process.platform === 'darwin') app.hide()
this.window.close()
this.window = null
}