From cf3b319fc7e19a9ab0fa87b8689ca82a82dc8a6f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 5 Apr 2016 18:33:48 -0700 Subject: [PATCH] Notification: Focus/unminimize/activate window on click Before, we would only focus, but not unminimize or show, etc. --- main/ipc.js | 4 ++++ renderer/index.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main/ipc.js b/main/ipc.js index 8c76c987..99682719 100644 --- a/main/ipc.js +++ b/main/ipc.js @@ -70,6 +70,10 @@ function init () { shortcuts.unregisterPlayerShortcuts() }) + ipcMain.on('focusWindow', function (e, windowName) { + windows.focusWindow(windows[windowName]) + }) + // Capture all events var oldEmit = ipcMain.emit ipcMain.emit = function (name, e, ...args) { diff --git a/renderer/index.js b/renderer/index.js index cd588594..f4c88199 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -982,7 +982,7 @@ function showDoneNotification (torrent) { }) notif.onclick = function () { - window.focus() + ipcRenderer.send('focusWindow', 'main') } playInterfaceSound('DONE')