remember window position

This commit is contained in:
Dan Flettre
2016-08-24 00:58:18 -05:00
parent 6541291e0d
commit aedbc3c32f
4 changed files with 41 additions and 11 deletions

View File

@@ -288,6 +288,7 @@ function setupIpc () {
ipcRenderer.on('dispatch', (e, ...args) => dispatch(...args))
ipcRenderer.on('fullscreenChanged', onFullscreenChanged)
ipcRenderer.on('windowBoundsChanged', onWindowBoundsChanged)
const tc = controllers.torrent
ipcRenderer.on('wt-infohash', (e, ...args) => tc.torrentInfoHash(...args))
@@ -462,6 +463,11 @@ function onFullscreenChanged (e, isFullScreen) {
update()
}
function onWindowBoundsChanged (e, newBounds) {
state.saved.bounds = newBounds
dispatch('saveStateThrottled')
}
function checkDownloadPath () {
fs.stat(state.saved.prefs.downloadPath, function (err, stat) {
if (err) {