Repository navigation
Implement 'activate' event for app. - #2777
Conversation
|
I think we can just add an |
|
Yes please 🌴 👍 |
|
@zcbenz Done. |
There was a problem hiding this comment.
In C++ we need to use the has_visible_windows style of variable names.
There was a problem hiding this comment.
Oh, I missed it. Done.
692606a to
37f2238
Compare
There was a problem hiding this comment.
We can probably emit activate directly in C++ and implement activate-with-no-open-windows like this:
app.on 'activate', (event, hasVisibleWindows) -> @emit 'activate-with-no-open-windows' if hasVisibleWindowsSo we can put activate-with-no-open-windows with other deprecated APIs together, and we don't need to have a _activate event.
37f2238 to
9652ed6
Compare
|
Thanks! |
Implement 'activate' event for app.
|
Kick ass 😄 👢 |
As mentioned on this Electron's issue: electron/electron#2777 The 'activate-with-open-windows' event has been deprecated in favor of a global 'activate' event with a 'hasVisibleWindows' parameter. This fixes Nylas from crashing when closing the main window and opening via clicking the Dock icon.
|
Just came here to say thanks for doing this :) Was a really useful option for us to have! |
| @@ -52,12 +52,8 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender | |||
| - (BOOL)applicationShouldHandleReopen:(NSApplication*)theApplication | |||
| hasVisibleWindows:(BOOL)flag { | |||
There was a problem hiding this comment.
Any reason why it was implemented with applicationShouldHandleReopen instead of applicationDidBecomeActive ?
Fixes #2671 .