Just focus mainWindow when notification is clicked on Windows
BrowserWindow.show() breaks Aero Snap state.
This commit is contained in:
@@ -52,7 +52,13 @@ function overrideNotification() {
|
|||||||
};
|
};
|
||||||
Notification.prototype.__defineSetter__('onclick', function(callback) {
|
Notification.prototype.__defineSetter__('onclick', function(callback) {
|
||||||
this.notification.onclick = function() {
|
this.notification.onclick = function() {
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
// show() breaks Aero Snap state.
|
||||||
|
electron.remote.getCurrentWindow().focus();
|
||||||
|
}
|
||||||
|
else {
|
||||||
electron.remote.getCurrentWindow().show();
|
electron.remote.getCurrentWindow().show();
|
||||||
|
}
|
||||||
ipc.sendToHost('onNotificationClick');
|
ipc.sendToHost('onNotificationClick');
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user