diff --git a/CHANGELOG.md b/CHANGELOG.md index 700f17a..b3ea023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/back/banner.ts b/src/back/banner.ts index 89349f7..1941c60 100644 --- a/src/back/banner.ts +++ b/src/back/banner.ts @@ -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 }