ipcMain.on('application:dock-message-notification', function(event, id) { dockNotificationCache[id] = dockNotificationCache[id] + 1; if (process.platform === 'darwin' || (process.platform === 'linux' && app.isUnityRunning && app.isUnityRunning())) { app.setBadgeCount(dockNotificationCache[id]); } if (process.platform === 'darwin') { app.dock.bounce(); } });
app.dock.bounce('informational'); prevUnreadCount = unreadCount;
onDone(item, beatmapSetId) { if (process.platform === 'darwin') { app.dock.downloadFinished(join(this.savePath, item.getFilename())); } this.sendToWin('download-succeeded', { beatmapSetId }); this.trackEvent('beatmapDownload', 'succeed', this.currentDownload.beatmapSetInfos.beatmapSetId); if (this.autoOpenOnDone) shell.openItem(item.getSavePath()); this.clearCurrentDownload(); this.executeQueue(); }
function createWindow() { initialize() if (windowProvider.getWindow() == null) { windowProvider.createMainWindow() menu.buildMenu(windowProvider) } else { if (process.platform === 'darwin') { app.dock.show() } windowProvider.getWindow().show() menu.buildMenu(windowProvider) } }
/** * Makes native application menu * @author @guryn */ makeMenu() { let createMenuTemplate = require('./menu'), menues = createMenuTemplate(app), menuBar = Menu.buildFromTemplate(menues.menuBar), menuDock = Menu.buildFromTemplate(menues.menuDock); Menu.setApplicationMenu(menuBar); app.dock.setMenu(menuDock); }
function setDockBadge(count) { if (process.platform === 'darwin') { //Coerce count into a string. Passing an empty string makes the badge disappear. remote.app.dock.setBadge('' + (count || '')); } }
// Show and Focus mainWindow function showWindow(){ mainWindow.show(); mainWindow.focus(); if (isMac) { app.dock.show(); } }
// Handle Get logger type request /* Window controls */ ipcMain.on('app-close', function (event, data) { if (data) { mainWindow.hide(); if (isMac) { app.dock.hide(); } } else { app.quit(); } });
ipcMain.on('app-bounce', (e, type) => { if (type !== 'critical' && type !== 'informational') { type = 'informational'; } e.returnValue = mainWindow.isFocused() ? -1 : app.dock.bounce(type); });