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