mirror of https://github.com/keeweb/keeweb.git
fix #1440: fixed auto-type for maximized windows
This commit is contained in:
parent
099f1ca9d0
commit
5b91dcb272
|
@ -222,10 +222,7 @@ const Launcher = {
|
||||||
return !!this.electron().remote.BrowserWindow.getFocusedWindow();
|
return !!this.electron().remote.BrowserWindow.getFocusedWindow();
|
||||||
},
|
},
|
||||||
showMainWindow() {
|
showMainWindow() {
|
||||||
const win = this.getMainWindow();
|
this.remoteApp().showAndFocusMainWindow();
|
||||||
win.show();
|
|
||||||
win.focus();
|
|
||||||
win.restore();
|
|
||||||
},
|
},
|
||||||
spawn(config) {
|
spawn(config) {
|
||||||
const ts = logger.ts();
|
const ts = logger.ts();
|
||||||
|
|
|
@ -15,6 +15,7 @@ let appReady = false;
|
||||||
let restartPending = false;
|
let restartPending = false;
|
||||||
let mainWindowPosition = {};
|
let mainWindowPosition = {};
|
||||||
let updateMainWindowPositionTimeout = null;
|
let updateMainWindowPositionTimeout = null;
|
||||||
|
let mainWindowMaximized = false;
|
||||||
|
|
||||||
const windowPositionFileName = 'window-position.json';
|
const windowPositionFileName = 'window-position.json';
|
||||||
const appSettingsFileName = 'app-settings.json';
|
const appSettingsFileName = 'app-settings.json';
|
||||||
|
@ -160,6 +161,7 @@ app.reqNative = function(mod) {
|
||||||
}
|
}
|
||||||
return binding;
|
return binding;
|
||||||
};
|
};
|
||||||
|
app.showAndFocusMainWindow = showAndFocusMainWindow;
|
||||||
|
|
||||||
function readAppSettings() {
|
function readAppSettings() {
|
||||||
const appSettingsFilePath = path.join(app.getPath('userData'), appSettingsFileName);
|
const appSettingsFilePath = path.join(app.getPath('userData'), appSettingsFileName);
|
||||||
|
@ -237,6 +239,12 @@ function createMainWindow() {
|
||||||
mainWindow.on('minimize', () => {
|
mainWindow.on('minimize', () => {
|
||||||
emitRemoteEvent('launcher-minimize');
|
emitRemoteEvent('launcher-minimize');
|
||||||
});
|
});
|
||||||
|
mainWindow.on('maximize', () => {
|
||||||
|
mainWindowMaximized = true;
|
||||||
|
});
|
||||||
|
mainWindow.on('unmaximize', () => {
|
||||||
|
mainWindowMaximized = false;
|
||||||
|
});
|
||||||
mainWindow.on('leave-full-screen', () => {
|
mainWindow.on('leave-full-screen', () => {
|
||||||
emitRemoteEvent('leave-full-screen');
|
emitRemoteEvent('leave-full-screen');
|
||||||
});
|
});
|
||||||
|
@ -266,6 +274,15 @@ function restoreMainWindow() {
|
||||||
setTimeout(destroyAppIcon, 0);
|
setTimeout(destroyAppIcon, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showAndFocusMainWindow() {
|
||||||
|
if (mainWindowMaximized) {
|
||||||
|
mainWindow.maximize();
|
||||||
|
} else {
|
||||||
|
mainWindow.show();
|
||||||
|
}
|
||||||
|
mainWindow.focus();
|
||||||
|
}
|
||||||
|
|
||||||
function closeMainWindow() {
|
function closeMainWindow() {
|
||||||
emitRemoteEvent('launcher-exit-request');
|
emitRemoteEvent('launcher-exit-request');
|
||||||
setTimeout(destroyAppIcon, 0);
|
setTimeout(destroyAppIcon, 0);
|
||||||
|
@ -335,6 +352,7 @@ function restoreMainWindowPosition() {
|
||||||
}
|
}
|
||||||
if (mainWindowPosition.maximized) {
|
if (mainWindowPosition.maximized) {
|
||||||
mainWindow.maximize();
|
mainWindow.maximize();
|
||||||
|
mainWindowMaximized = true;
|
||||||
}
|
}
|
||||||
if (mainWindowPosition.fullScreen) {
|
if (mainWindowPosition.fullScreen) {
|
||||||
mainWindow.setFullScreen(true);
|
mainWindow.setFullScreen(true);
|
||||||
|
|
|
@ -11,6 +11,7 @@ Release notes
|
||||||
`+` #1350: clearing master password after auto lock period
|
`+` #1350: clearing master password after auto lock period
|
||||||
`-` fix #1463: copying the original url instead of adding https:
|
`-` fix #1463: copying the original url instead of adding https:
|
||||||
`-` fix #620: clearing middle-click clipboard in Linux
|
`-` fix #620: clearing middle-click clipboard in Linux
|
||||||
|
`-` fix #1440: fixed auto-type for maximized windows
|
||||||
|
|
||||||
##### v1.14.3 (2020-05-15)
|
##### v1.14.3 (2020-05-15)
|
||||||
`*` improved exporting files with markdown notes
|
`*` improved exporting files with markdown notes
|
||||||
|
|
Loading…
Reference in New Issue