From 9872fa0f52a2dec9ec5702481c7476f007965588 Mon Sep 17 00:00:00 2001 From: gellert Date: Tue, 2 Aug 2016 15:17:50 +0200 Subject: [PATCH] restoring default app --- default_app/default_app.js | 42 ++++++++------------------------------ default_app/main.js | 3 +-- 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/default_app/default_app.js b/default_app/default_app.js index 74c957b7e7f..bfb97a9ab08 100644 --- a/default_app/default_app.js +++ b/default_app/default_app.js @@ -3,9 +3,6 @@ const path = require('path') let mainWindow = null -app.commandLine.appendSwitch('--disable-gpu'); -app.commandLine.appendSwitch('--disable-gpu-compositing'); - // Quit when all windows are closed. app.on('window-all-closed', () => { app.quit() @@ -13,42 +10,19 @@ app.on('window-all-closed', () => { exports.load = (appUrl) => { app.on('ready', () => { - mainWindow = new BrowserWindow({ + const options = { width: 800, height: 600, - show: false, autoHideMenuBar: true, backgroundColor: '#FFFFFF', - useContentSize: true, - webPreferences: { - offscreen: true, - nodeIntegration: false, - backgroundThrottling: false - } - }) + useContentSize: true + } + if (process.platform === 'linux') { + options.icon = path.join(__dirname, 'icon.png') + } + + mainWindow = new BrowserWindow(options) mainWindow.loadURL(appUrl) mainWindow.focus() - - mainWindow.webContents.on('dom-ready', () => { - mainWindow.webContents.setFrameRate(10) - let ping = true - setInterval(() => { - if (ping) { - mainWindow.webContents.startPainting() - } else { - mainWindow.webContents.stopPainting() - } - - ping = !ping - }, 3000) - }) - - setInterval(() => { - console.log(mainWindow.webContents.isPainting()) - }, 500) - - mainWindow.webContents.on('paint', (e, rect, data) => { - console.log('painting', data.length) - }) }) } diff --git a/default_app/main.js b/default_app/main.js index c09b91ca155..ceb7d1677c4 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -329,6 +329,5 @@ if (option.file && !option.webdriver) { startRepl() } else { const indexPath = path.join(__dirname, '/index.html') - //loadApplicationByUrl(`http://www.e-try.com/black.htm`) - loadApplicationByUrl(`http://mrdoob.com/lab/javascript/requestanimationframe/`) + loadApplicationByUrl(`file://${indexPath}`) }