diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-05-03 15:01:19 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-05-03 18:35:00 +0200 |
| commit | 81040827af694d0fbb787cb12f10386e69aedee6 (patch) | |
| tree | 8e2d850985e9ac85912eadc5a7f8e4729370fd55 /gui | |
| parent | f65461d9353b0dc330a062d79f455531ebab1516 (diff) | |
| download | mullvadvpn-81040827af694d0fbb787cb12f10386e69aedee6.tar.xz mullvadvpn-81040827af694d0fbb787cb12f10386e69aedee6.zip | |
Add log message if content height is incorrect
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/renderer/app.tsx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx index 6f656c5dfe..7627428059 100644 --- a/gui/src/renderer/app.tsx +++ b/gui/src/renderer/app.tsx @@ -240,6 +240,8 @@ export default class AppRenderer { if (initialState.isConnected) { consumePromise(this.onDaemonConnected()); } + + this.checkContentHeight(); } public renderView() { @@ -520,6 +522,24 @@ export default class AppRenderer { return preferredLocale ? preferredLocale.name : ''; } + // Make sure that the content height is correct and log if it isn't. This is mostly for debugging + // purposes since there's a bug in Electron that causes the app height to be another value than + // the one we have set. + // https://github.com/electron/electron/issues/28777 + private checkContentHeight(): void { + let expectedContentHeight = 568; + + // The app content is 12px taller on macOS to fit the top arrow. + if (window.platform === 'darwin' && !this.guiSettings.unpinnedWindow) { + expectedContentHeight += 12; + } + + const contentHeight = window.innerHeight; + if (contentHeight !== expectedContentHeight) { + log.error(`Wrong content height ${contentHeight}, expected ${expectedContentHeight}`); + } + } + private redirectToConnect() { // Redirect the user after some time to allow for the 'Logged in' screen to be visible this.loginScheduler.schedule(() => this.resetNavigation(), 1000); |
