ELECTRON-956 - removing the minimize and maximize from the configure desktop alert position (#535)

This commit is contained in:
VICTOR RAPHAEL BRAGA DE SALES MASCARENHAS 2019-01-15 11:06:19 -02:00 committed by Vishwas Shashidhar
parent 9a049a3b20
commit a1426c79b6
2 changed files with 16 additions and 2 deletions

View File

@ -441,8 +441,8 @@ function getTemplate(app) {
// This adds About Symphony under help menu for windows
template[3].submenu.push({
label: i18n.getMessageFor('About Symphony'),
click(focusedWindow) {
let windowName = focusedWindow ? focusedWindow.name : '';
click(menuItem, focusedWindow) {
let windowName = focusedWindow ? focusedWindow.winName : '';
aboutApp.openAboutWindow(windowName);
}
});

View File

@ -504,6 +504,7 @@ function doCreateMainWindow(initialUrl, initialBounds, isCustomTitleBar) {
newWinOptions.minHeight = MIN_HEIGHT;
newWinOptions.alwaysOnTop = alwaysOnTop;
newWinOptions.frame = true;
newWinOptions.parent = null;
let newWinKey = getGuid();
@ -795,6 +796,19 @@ function doCreateMainWindow(initialUrl, initialBounds, isCustomTitleBar) {
}
/**
* ELECTRON-956: App is not minimized upon "Configure Desktop Alert Position" modal when "Always on Top" = True
*/
app.on('browser-window-created', (event, window) => {
const parentWindow = window.getParentWindow();
if (parentWindow && !parentWindow.isDestroyed()) {
if (parentWindow.winName === 'main') {
window.setMinimizable(false);
window.setMaximizable(false);
}
}
});
/**
* Handles the event before-quit emitted by electron
*/