Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: restore mainWindow on MacOS #608

Merged
merged 2 commits into from
Feb 21, 2023
Merged

Conversation

Falci
Copy link
Contributor

@Falci Falci commented Feb 16, 2023

Restore the main window from the dock (MacOS only)

Copy link
Contributor

@handshake-enthusiast handshake-enthusiast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this address Bob Wallet app window stops showing after some time? If so this is a great change to a very annoying issue!

app/main.js Outdated
@@ -102,6 +102,12 @@ if (isPrimaryInstance) {
}
});

app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe Apple changed their OS naming from old OS X to macOS.

@rithvikvibhu
Copy link
Collaborator

@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
Copy link
Contributor Author

Falci commented Feb 20, 2023

@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.

Screen.Recording.2023-02-20.at.08.43.20.mov

And the focus() change wasn't necessary.

@handshake-enthusiast
Copy link
Contributor

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

@rithvikvibhu rithvikvibhu merged commit 33f7431 into kyokan:master Feb 21, 2023
@rithvikvibhu
Copy link
Collaborator

Oh cool, that makes sense, thanks!

@Falci Falci deleted the come-back1 branch June 6, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants