summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-11-11 10:11:05 +0100
committerOskar Nyberg <oskar@mullvad.net>2020-11-19 11:22:02 +0100
commit85158770f0fd8009c6ca9b45d78ed8d3f4757d05 (patch)
tree8bd2b927057eb58328252af2e306ae09e99e6798
parent585f019300df75cdac366a7ecbdf7f9b8184cce1 (diff)
downloadmullvadvpn-85158770f0fd8009c6ca9b45d78ed8d3f4757d05.tar.xz
mullvadvpn-85158770f0fd8009c6ca9b45d78ed8d3f4757d05.zip
Fix for Windows app width increase when opened from minimized
-rw-r--r--gui/src/main/window-controller.ts23
1 files changed, 19 insertions, 4 deletions
diff --git a/gui/src/main/window-controller.ts b/gui/src/main/window-controller.ts
index 4c4b744b79..09b8d7651f 100644
--- a/gui/src/main/window-controller.ts
+++ b/gui/src/main/window-controller.ts
@@ -208,11 +208,26 @@ export default class WindowController {
private showImmediately() {
const window = this.windowValue;
- this.updatePosition();
- this.notifyUpdateWindowShape();
+ // When running with unpinned window on Windows there's a bug that causes the app to become
+ // wider if opened from minimized if the updated position is set before the window is opened.
+ // Unfortunately the order can't always be changed since this would cause the Window to "jump"
+ // in other scenarios.
+ if (
+ process.platform === 'win32' &&
+ this.windowPositioning instanceof StandaloneWindowPositioning
+ ) {
+ window.show();
+ window.focus();
- window.show();
- window.focus();
+ this.updatePosition();
+ this.notifyUpdateWindowShape();
+ } else {
+ this.updatePosition();
+ this.notifyUpdateWindowShape();
+
+ window.show();
+ window.focus();
+ }
}
private updatePosition() {