Set parent window for about/new version, escape to close (#1795)
* Set parent window for about/new version, escape to close * Exclude jquery from jshint run
This commit is contained in:
parent
158b575885
commit
1c455c83e0
6 changed files with 9241 additions and 6 deletions
16
main.js
16
main.js
|
@ -22,6 +22,10 @@ app.setAppUserModelId('org.whispersystems.signal-desktop')
|
|||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow;
|
||||
|
||||
function getMainWindow() {
|
||||
return mainWindow;
|
||||
}
|
||||
|
||||
const config = require("./app/config");
|
||||
|
||||
if (config.environment === 'production' && !process.mas) {
|
||||
|
@ -241,7 +245,8 @@ function showAbout() {
|
|||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
},
|
||||
parent: mainWindow,
|
||||
};
|
||||
|
||||
aboutWindow = new BrowserWindow(options);
|
||||
|
@ -269,7 +274,7 @@ app.on('ready', function() {
|
|||
locale = loadLocale();
|
||||
}
|
||||
|
||||
autoUpdate.initialize(locale.messages);
|
||||
autoUpdate.initialize(getMainWindow, locale.messages);
|
||||
|
||||
createWindow();
|
||||
|
||||
|
@ -342,3 +347,10 @@ ipc.on("set-auto-hide-menu-bar", function(event, autoHide) {
|
|||
ipc.on("set-menu-bar-visibility", function(event, visibility) {
|
||||
mainWindow.setMenuBarVisibility(visibility);
|
||||
});
|
||||
|
||||
ipc.on("close-about", function() {
|
||||
if (aboutWindow) {
|
||||
aboutWindow.close();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue