onConsoleChange(type) { let currentWindow = remote.getCurrentWindow(); if(!currentWindow.isFocused()) { ipcRenderer.send('application:dock-message-notification', currentWindow.id); } if(this.state.showConsole) { return; } ReplStore.showBell(); }
app.on('browser-window-focus', (event, window) => { window.$focus = true; dockNotificationCache[window.id] = 0; if (process.platform === 'darwin' || (process.platform === 'linux' && app.isUnityRunning && app.isUnityRunning())) { app.setBadgeCount(0); } });
function onCloseWindow(e, title, detail) { // save history const window = BrowserWindow.getFocusedWindow(); if(window && window.id && windowCache[window.id]) { saveHistory(null, windowCache[window.id].history); windowCache[window.id].history = []; } let ret = promptOnClose; if(promptOnClose) { try { ret = !!dialog.showMessageBox(window, { title: title || 'Close Window', buttons: ['Close', 'Cancel'], type: 'question', message: title || 'Close Window', detail: detail || `Do you want to close this window?` }); } catch(e) { ret = false; } } if(ret) { e.preventDefault(); } e.returnValue = !ret; }
let id = mainWindow.id; windowCache[id] = mainWindow; let menuManager = menuManagerCache[id] = new MenuManager(argv);
BrowserWindow.getAllWindows().forEach(function (win) { if (win.id > 1) { win.close() } })
const listener = async (event, data) => { const browserWindow = BrowserWindow.fromWebContents(event.sender); if (window && window.id !== browserWindow.id) { return; } const send = (channel, data) => { if (!(browserWindow && browserWindow.isDestroyed())) { event.sender.send(channel, data); } }; const {dataChannel, errorChannel, userData} = data; try { send(dataChannel, await callback(userData, browserWindow)); } catch (error) { send(errorChannel, serializeError(error)); } }
BrowserWindow.getAllWindows().forEach(function(win) { if (win.id > 1) { win.close() } })
BrowserWindow.getAllWindows().forEach(function(win) { if (win.id > 1) { win.close() } })