Handle opening 2 instances of GDevelop#8167
Conversation
ClementPasteau
commented
Jan 26, 2026
- this creates a window inside the existing electron app, instead of a new app, allowing to have everything under 1 app in the taskbar
- it is created in a different context, allowing indexedDb and storage to be different, for firebase to be independent, so allow logging in to different accounts
- previews are independent, so we can start previews for each window and they're fully working
- Fix closing a window now automatically closes the preview(s) associated to avoid having a crash when closing the preview
- protect all calls to avoid sending messages from/to non-existing sources
176cc57 to
3164e40
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3164e40a39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }); | ||
|
|
||
| // Create a new window in the existing process | ||
| createNewWindow(secondInstanceArgs); |
There was a problem hiding this comment.
Propagate second-instance args to new windows
When a second instance is launched, you parse secondInstanceArgs and create a new window, but the renderer still reads arguments via remote.getGlobal('args') (see Window.getArguments()), and global['args'] is only set once at app startup. That means windows opened from a second launch will still see the first instance’s arguments (e.g., the project path or --disable-update-check), so the new window won’t open the intended project/flags. This shows up when users launch the app a second time with a different project path.
Useful? React with 👍 / 👎.
|
closing for #8205 |