focus() visible window on show-window instead of show() (#1455)

When clicking on a notification in Windows when a window had been stuck
to one side of the screen using Snap, the window would be repositioned.

Fixes #1453

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-09-11 09:47:04 -07:00
parent db869c6ce4
commit 272955b9d6
No known key found for this signature in database
GPG Key ID: A4931C09644C654B
1 changed files with 9 additions and 1 deletions

10
main.js
View File

@ -146,7 +146,15 @@ function createWindow () {
});
ipc.on('show-window', function() {
mainWindow.show();
// Using focus() instead of show() seems to be important on Windows when our window
// has been docked using Aero Snap/Snap Assist. A full .show() call here will cause
// the window to reposition:
// https://github.com/WhisperSystems/Signal-Desktop/issues/1429
if (mainWindow.isVisible()) {
mainWindow.focus();
} else {
mainWindow.show();
}
});
}