From 2f4fe3e521f7f09c29aba7b38f5813ab10c63e62 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 3 Feb 2017 02:04:17 -0800 Subject: [PATCH] disable background throttling in all windows --- src/main/windows/main.js | 7 ++++--- src/main/windows/webtorrent.js | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/windows/main.js b/src/main/windows/main.js index 9da3bb58..2e65a720 100644 --- a/src/main/windows/main.js +++ b/src/main/windows/main.js @@ -32,16 +32,17 @@ function init (state, options) { const win = main.win = new electron.BrowserWindow({ backgroundColor: '#282828', + backgroundThrottling: false, // do not throttle animations/timers when page is background darkTheme: true, // Forces dark theme (GTK+3) + height: initialBounds.height, icon: getIconPath(), // Window icon (Windows, Linux) - minWidth: config.WINDOW_MIN_WIDTH, minHeight: config.WINDOW_MIN_HEIGHT, + minWidth: config.WINDOW_MIN_WIDTH, + show: false, title: config.APP_WINDOW_TITLE, titleBarStyle: 'hidden-inset', // Hide title bar (Mac) useContentSize: true, // Specify web page size without OS chrome - show: false, width: initialBounds.width, - height: initialBounds.height, x: initialBounds.x, y: initialBounds.y }) diff --git a/src/main/windows/webtorrent.js b/src/main/windows/webtorrent.js index a524c686..0534eb7d 100644 --- a/src/main/windows/webtorrent.js +++ b/src/main/windows/webtorrent.js @@ -13,6 +13,7 @@ const config = require('../../config') function init () { const win = webtorrent.win = new electron.BrowserWindow({ backgroundColor: '#1E1E1E', + backgroundThrottling: false, // do not throttle animations/timers when page is background center: true, fullscreen: false, fullscreenable: false,