From 3591f6b91df77f8fab7a5ad2a21adc0e4bb03efe Mon Sep 17 00:00:00 2001 From: MAKIO135 Date: Fri, 1 Mar 2019 17:33:59 +0100 Subject: [PATCH] fix size reloading issues on windows --- desktop/index.js | 4 ++-- desktop/src/scripts/main.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/desktop/index.js b/desktop/index.js index a3ed844..6abaabd 100644 --- a/desktop/index.js +++ b/desktop/index.js @@ -11,8 +11,8 @@ app.on('ready', () => { resizable: true, icon: __dirname + '/icon.ico', frame: process.platform !== 'darwin', - skipTaskbar: process.platform === 'darwin', - autoHideMenuBar: process.platform === 'darwin' + skipTaskbar: true, + autoHideMenuBar: true }) app.win.loadFile('index.html') diff --git a/desktop/src/scripts/main.js b/desktop/src/scripts/main.js index b92d3b9..8b7353c 100644 --- a/desktop/src/scripts/main.js +++ b/desktop/src/scripts/main.js @@ -13,7 +13,7 @@ const hostsList = document.getElementById('hosts') const addButton = document.querySelector('[data-action="add"]') const shortcuts = document.getElementById('shortcuts') addEventListener('load', e => { - app.win.setSize(config.width, config.height) + app.win.setContentSize(config.width, config.height) if(config.displayShortcuts) shortcuts.classList.toggle('open') }) @@ -39,7 +39,7 @@ function validateHost(el) { osc.removeClient(index) config.hosts = hosts // helpers.updateConfig(config) - app.win.setSize(app.win.getSize()[0], shortcuts.getBoundingClientRect().bottom) + app.win.setContentSize(app.win.getContentSize()[0], shortcuts.getBoundingClientRect().bottom) } helpers.unfocus(el) @@ -166,7 +166,7 @@ function addHostLi(host, selected = true) { // Events addEventListener('resize', helpers.debounce(e => { // update config.json - const dimensions = app.win.getSize() + const dimensions = app.win.getContentSize() config.width = dimensions[0] config.height = dimensions[1] config.displayShortcuts = shortcuts.classList.contains('open') @@ -175,12 +175,12 @@ addEventListener('resize', helpers.debounce(e => { addButton.addEventListener('click', e => { addHostLi() - app.win.setSize(app.win.getSize()[0], shortcuts.getBoundingClientRect().bottom) + app.win.setContentSize(app.win.getContentSize()[0], shortcuts.getBoundingClientRect().bottom) }) shortcuts.querySelector('p').addEventListener('click', () => { shortcuts.classList.toggle('open') - app.win.setSize(app.win.getSize()[0], shortcuts.getBoundingClientRect().bottom) + app.win.setContentSize(app.win.getContentSize()[0], shortcuts.getBoundingClientRect().bottom) config.width = innerWidth config.height = innerHeight config.displayShortcuts = shortcuts.classList.contains('open')