From 44b8302b6cd6a673f665485a9931d00050b5b6ee Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 5 Mar 2016 18:14:05 -0800 Subject: [PATCH 1/3] don't resize window when in fullscreen --- renderer/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/renderer/index.js b/renderer/index.js index df897f4b..97f9ebe1 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -350,6 +350,8 @@ function openAirplay (torrent) { } function setDimensions (dimensions) { + if (state.isFullScreen) return + state.mainWindowBounds = electron.remote.getCurrentWindow().getBounds() // Limit window size to screen size From 79c2295775acd4843e520856faf9ca0f1b664f0c Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 5 Mar 2016 18:28:54 -0800 Subject: [PATCH 2/3] move isFullScreen check to ipc.js --- main/ipc.js | 2 +- renderer/index.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/main/ipc.js b/main/ipc.js index a61da263..7c03cad2 100644 --- a/main/ipc.js +++ b/main/ipc.js @@ -45,7 +45,7 @@ function addTorrentFromPaste () { function setBounds (bounds) { debug('setBounds %o', bounds) - if (windows.main) { + if (windows.main && !windows.main.isFullScreen()) { windows.main.setBounds(bounds, true) } } diff --git a/renderer/index.js b/renderer/index.js index 97f9ebe1..df897f4b 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -350,8 +350,6 @@ function openAirplay (torrent) { } function setDimensions (dimensions) { - if (state.isFullScreen) return - state.mainWindowBounds = electron.remote.getCurrentWindow().getBounds() // Limit window size to screen size From 69a078ad4cace2e1bd2cd7dda987e3ae13b8213e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 5 Mar 2016 18:31:18 -0800 Subject: [PATCH 3/3] Header tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change does the following: - Show the header on Linux/Windows when fullscreened, but not in the player. Users might fullscreen the app when they’re not playing a video. - Always show the header on OS X (even when fullscreened) since that’s how the user will exit the video. We can work on adding auto-hiding to it later. --- renderer/views/app.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/renderer/views/app.js b/renderer/views/app.js index 56c93bb3..ae9aa38f 100644 --- a/renderer/views/app.js +++ b/renderer/views/app.js @@ -8,7 +8,23 @@ var Header = require('./header') var Player = require('./player') var TorrentList = require('./torrent-list') +var isOSX = process.platform === 'darwin' + function App (state, dispatch) { + return hx` +
+ ${getHeader()} +
${getView()}
+
+ ` + + function getHeader () { + // Hide the header on Windows/Linux when in the player + if (isOSX || state.url !== '/player') { + return Header(state, dispatch) + } + } + function getView () { if (state.url === '/') { return TorrentList(state, dispatch) @@ -16,18 +32,4 @@ function App (state, dispatch) { return Player(state, dispatch) } } - - // Show the header only when we're outside of fullscreen - // Also don't show it in the video player except in OSX - var isOSX = process.platform === 'darwin' - var isVideo = state.url === '/player' - var isFullScreen = state.isFullScreen - var header = !isFullScreen && (!isVideo || isOSX) ? Header(state, dispatch) : null - - return hx` -
- ${header} -
${getView()}
-
- ` }