Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Cross-communication between multiple instances of Oni #250

Closed
keforbes opened this issue Feb 23, 2017 · 1 comment · Fixed by #262
Closed

Cross-communication between multiple instances of Oni #250

keforbes opened this issue Feb 23, 2017 · 1 comment · Fixed by #262

Comments

@keforbes
Copy link
Collaborator

I don't know if this is related to #247 or not so I'm filing it as a new issue. I've noticed that if I have multiple instances of Oni running, only the most recently launched Oni will display DevTools. It looks like there's some cross-communication going on between instances and only the last DevTools listener is active. It's possible there are other listeners that are mixed up as well but the DevTools one is the most noticeable to me.

multiple_instances

@bryphe
Copy link
Member

bryphe commented Feb 24, 2017

It looks like this is because we are using Menu.setApplicationMenu - and the behavior for that is to set the menu for all BrowserWindow instances. When the new window is created, this overrides the previous window.

We have a few options:

  • Check to see if there is a way to set the menu per-BrowserWindow.' I checked quickly at the electron API docs and it didn't look like it... But it'd be worth a more thorough check because this would be the most straightforward way
  • Hook the activate or focus event of the BrowserWindow (can't remember the exact name) - and build the menu at that time. Eventually, we'll want to support this dynamic menu creation anyway - an example of this is that, I'd like to be able to add the language service commands like "Goto Definition", "Quick Fix", etc - and it'd be nice to be able to disable/enable them dynamically based on what the current language plugin supports.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants