Retain previous screen sizing on startup #1057

Merged
miikkatu merged 1 commit from master into master 2018-03-21 14:29:51 +01:00
4 changed files with 34 additions and 4 deletions

View file

@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
* Codacy support for Github contributions ([#1059](https://github.com/lbryio/lbry-app/pull/1059)) * Codacy support for Github contributions ([#1059](https://github.com/lbryio/lbry-app/pull/1059))
* App category for Linux ([#877](https://github.com/lbryio/lbry-app/pull/877)) * App category for Linux ([#877](https://github.com/lbryio/lbry-app/pull/877))
* Add YouTube Sync reward ([1147](https://github.com/lbryio/lbry-app/pull/1147)) * Add YouTube Sync reward ([1147](https://github.com/lbryio/lbry-app/pull/1147))
* Retain previous screen sizing on startup ([#338](https://github.com/lbryio/lbry-app/issues/338))
### Changed ### Changed
* Update LBRY Protocol to 0.19.1 (See change log for [0.19.0](https://github.com/lbryio/lbry/releases/tag/v0.19.0) and [0.19.1](https://github.com/lbryio/lbry/releases/tag/v0.19.1)) * Update LBRY Protocol to 0.19.1 (See change log for [0.19.0](https://github.com/lbryio/lbry/releases/tag/v0.19.0) and [0.19.1](https://github.com/lbryio/lbry/releases/tag/v0.19.1))

View file

@ -39,6 +39,7 @@
"electron-log": "^2.2.12", "electron-log": "^2.2.12",
"electron-publisher-s3": "^20.2.0", "electron-publisher-s3": "^20.2.0",
"electron-updater": "^2.21.0", "electron-updater": "^2.21.0",
"electron-window-state": "^4.1.1",
"find-process": "^1.1.0", "find-process": "^1.1.0",
"formik": "^0.10.4", "formik": "^0.10.4",
"from2": "^2.3.0", "from2": "^2.3.0",

View file

@ -1,15 +1,32 @@
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
import { app, BrowserWindow, dialog } from 'electron'; import { app, BrowserWindow, dialog, screen } from 'electron';
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
import isDev from 'electron-is-dev'; import isDev from 'electron-is-dev';
import windowStateKeeper from 'electron-window-state';
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
import setupBarMenu from './menu/setupBarMenu'; import setupBarMenu from './menu/setupBarMenu';
import setupContextMenu from './menu/setupContextMenu'; import setupContextMenu from './menu/setupContextMenu';
export default appState => { export default appState => {
// Get primary display dimensions from Electron.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
// Load the previous state with fallback to defaults.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
const windowState = windowStateKeeper({
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
defaultWidth: width,
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
defaultHeight: height,
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
});
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
let windowConfiguration = { let windowConfiguration = {
backgroundColor: '#155B4A', backgroundColor: '#155B4A',
minWidth: 800, minWidth: 800,
minHeight: 600, minHeight: 600,
autoHideMenuBar: true, autoHideMenuBar: true,
show: false, show: false,
// Create the window using the state information.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
x: windowState.x,
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
y: windowState.y,
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
// If state is undefined, create window as maximized.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
width: windowState.width === undefined ? width : windowState.width,
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
height: windowState.height === undefined ? height : windowState.height,
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
}; };
// Disable renderer process's webSecurity on development to enable CORS. // Disable renderer process's webSecurity on development to enable CORS.
@ -28,7 +45,10 @@ export default appState => {
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
let window = new BrowserWindow(windowConfiguration); let window = new BrowserWindow(windowConfiguration);
window.maximize(); // Let us register listeners on the window, so we can update the state
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
// automatically (the listeners will be removed when the window is closed)
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
// and restore the maximized or full screen state.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
windowState.manage(window);
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
window.loadURL(rendererURL); window.loadURL(rendererURL);

liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
liamcardenas commented 2018-03-02 02:56:44 +01:00 (Migrated from github.com)
Review

is there any way that we can have a fully maximized default?

is there any way that we can have a fully maximized default?
miikkatu commented 2018-03-02 08:41:45 +01:00 (Migrated from github.com)
Review

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.

View file

@ -3106,6 +3106,14 @@ electron-webpack@^1.13.0:
webpack-merge "^4.1.1" webpack-merge "^4.1.1"
yargs "^11.0.0" yargs "^11.0.0"
electron-window-state@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/electron-window-state/-/electron-window-state-4.1.1.tgz#6b34fdc31b38514dfec8b7c8f7b5d4addb67632d"
dependencies:
deep-equal "^1.0.1"
jsonfile "^2.2.3"
mkdirp "^0.5.1"
electron@1.7.12: electron@1.7.12:
version "1.7.12" version "1.7.12"
resolved "https://registry.yarnpkg.com/electron/-/electron-1.7.12.tgz#dcc61a2c1b0c3df25f68b3425379a01abd01190e" resolved "https://registry.yarnpkg.com/electron/-/electron-1.7.12.tgz#dcc61a2c1b0c3df25f68b3425379a01abd01190e"
@ -5640,7 +5648,7 @@ json5@^0.5.0, json5@^0.5.1:
version "0.5.1" version "0.5.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
jsonfile@^2.1.0: jsonfile@^2.1.0, jsonfile@^2.2.3:
version "2.4.0" version "2.4.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
optionalDependencies: optionalDependencies: