Skip to content

Commit f1c0ab6

Browse files
committed
restore focus to orignal window
1 parent 53c16e7 commit f1c0ab6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Restore focus to previous window when closing banner
1213
- Responsive image
1314

1415
### Fixed

src/back/banner.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { join } from 'path'
22
import os from 'os'
3-
import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron'
3+
import { app, BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron'
44
import dayjs from 'dayjs'
55
import logger from 'electron-log'
66
import ms from 'ms'
@@ -64,6 +64,9 @@ export default class Banner {
6464
static close() {
6565
if (this.window) {
6666
Settings.save('lastRun', Date.now())
67+
this.window.minimize()
68+
this.window.hide()
69+
if (process.platform === 'darwin') app.hide()
6770
this.window.close()
6871
this.window = null
6972
}

0 commit comments

Comments
 (0)