mirror of
https://github.com/heyman/heynote.git
synced 2025-06-28 13:31:38 +02:00
fix(macos): show window on dock click when using menu bar mode
When "Show in menu bar" is enabled and the window is closed, clicking the app icon in the dock now properly shows the window again instead of only focusing it.
This commit is contained in:
parent
a4ca3198a9
commit
82494d818b
@ -351,10 +351,14 @@ app.on('second-instance', () => {
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
app.on('activate', (event, hasVisibleWindows) => {
|
||||
const allWindows = BrowserWindow.getAllWindows()
|
||||
if (allWindows.length) {
|
||||
allWindows[0].focus()
|
||||
// show the window if it's hidden (e.g. the window was closed with "show in menu bar" setting turned on)
|
||||
if (!allWindows[0].isVisible()) {
|
||||
allWindows[0].show()
|
||||
}
|
||||
} else {
|
||||
createWindow()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user