store window ref globally so when splitting files its easier to access.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
53e2ce33b8
commit
b6d2ba2019
3 changed files with 15 additions and 21 deletions
|
@ -185,7 +185,7 @@ electron.app.on('ready', () => {
|
|||
defaultHeight: 768,
|
||||
});
|
||||
|
||||
mainWindow = new electron.BrowserWindow({
|
||||
mainWindow = global.mainWindow = new electron.BrowserWindow({
|
||||
icon: iconPath,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
|
@ -203,7 +203,7 @@ electron.app.on('ready', () => {
|
|||
mainWindow.hide();
|
||||
|
||||
// Create trayIcon icon
|
||||
tray.create(mainWindow, {
|
||||
tray.create({
|
||||
icon_path: iconPath,
|
||||
brand: vectorConfig.brand || 'Riot',
|
||||
});
|
||||
|
@ -215,7 +215,7 @@ electron.app.on('ready', () => {
|
|||
}
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = null;
|
||||
mainWindow = global.mainWindow = null;
|
||||
});
|
||||
mainWindow.on('close', (e) => {
|
||||
if (!global.appQuitting && (tray.hasTray() || process.platform === 'darwin')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue