WIP: fix: write position of window

This commit is contained in:
Cutls 2019-10-03 01:38:21 +09:00
parent 8117ddb6ce
commit 02f49cd392

View File

@ -204,6 +204,7 @@ function createWindow() {
});
closeArg = false
mainWindow.on('close', function (e, arg) {
writePos(mainWindow)
if(!closeArg){
e.preventDefault()
}
@ -212,7 +213,6 @@ function createWindow() {
setTimeout(function () { resolve() }, 3000)
})
promise.then((function (response) {
writePos(mainWindow)
closeArg = true
mainWindow.close()
})
@ -236,9 +236,11 @@ function createWindow() {
fs.writeFileSync(info_path, JSON.stringify(size))
}
mainWindow.on('maximize', function () {
writePos(mainWindow)
fs.writeFileSync(max_info_path, JSON.stringify(mainWindow.getBounds()));
});
mainWindow.on('minimize', function () {
writePos(mainWindow)
mainWindow.webContents.send('asRead', "")
})