Just focus mainWindow when notification is clicked on Windows

BrowserWindow.show() breaks Aero Snap state.
This commit is contained in:
Yuya Ochiai
2015-12-23 17:42:21 +09:00
parent 69a1c177a1
commit f57e2a94ef

View File

@@ -52,7 +52,13 @@ function overrideNotification() {
};
Notification.prototype.__defineSetter__('onclick', function(callback) {
this.notification.onclick = function() {
electron.remote.getCurrentWindow().show();
if (process.platform === 'win32') {
// show() breaks Aero Snap state.
electron.remote.getCurrentWindow().focus();
}
else {
electron.remote.getCurrentWindow().show();
}
ipc.sendToHost('onNotificationClick');
callback();
};