kyokan / bob-wallet

Bob Wallet is a GUI for DNS Record Management and Name Auctions on Handshake. It includes an integrated full node: hsd
https://www.bobwallet.io/
GNU General Public License v3.0
380 stars 92 forks source link

chore: restore mainWindow on MacOS #608

Closed Falci closed 1 year ago

Falci commented 1 year ago

Restore the main window from the dock (MacOS only)

rithvikvibhu commented 1 year ago

@Falci can you explain a bit on what this does or aims to fix? (I'm not a macos user :|)

From electron docs:

Emitted when the application is activated. Various actions can trigger this event, such as launching the application for the first time, attempting to re-launch the application when it's already running, or clicking on the application's dock or taskbar icon.

Also, re: the change from focus() to show(), looks like show() is macos-only:

app.show() macOS Shows application windows after they were hidden. Does not automatically focus them.

Falci commented 1 year ago

@Falci can you explain a bit on what this does or aims to fix?

Sure. On Mac, when we close Bob (x or cmd+q) the main window disappear but the dock shows Bob as active, as if we could restore it. But if we try to restore, nothing happens. While there's a check to for the window-all-closed that prevents the app to be terminated, there was nothing there to recreate the mainWindow when the app is active again.

https://user-images.githubusercontent.com/1330573/220043600-e92a8f65-6fc0-4356-a3c7-15fd6f14b8db.mov

And the focus() change wasn't necessary.

handshake-enthusiast commented 1 year ago

I can confirm the same happens for me. Would be great to have a patch version release once it’s merged.

rithvikvibhu commented 1 year ago

Oh cool, that makes sense, thanks!