From c2496106dc12da416434cc833546cfc8c44f852e Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 18 Sep 2018 22:33:02 +0900 Subject: [PATCH] ing --- src/app/app.component.ts | 4 ++-- src/electron/app-window.ts | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 567b39e..e66a0c5 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,8 +15,8 @@ export class AppComponent implements OnInit { private electronProxyService: ElectronProxyService, private probeService: ProbeService, ) { - this.showTitleBar = !__LINUX__; - // this.showTitleBar = true; + // this.showTitleBar = !__LINUX__; + this.showTitleBar = true; } ngOnInit(): void { diff --git a/src/electron/app-window.ts b/src/electron/app-window.ts index 419bb04..02a41c6 100644 --- a/src/electron/app-window.ts +++ b/src/electron/app-window.ts @@ -93,6 +93,29 @@ export class AppWindow { } }); } + + if (__WIN32__) { + // workaround for known issue with fullscreen-ing the app and restoring + // is that some Chromium API reports the incorrect bounds, so that it + // will leave a small space at the top of the screen on every other + // maximize + // + // adapted from https://github.com/electron/electron/issues/12971#issuecomment-403956396 + // + // can be tidied up once https://github.com/electron/electron/issues/12971 + // has been confirmed as resolved + this.window.once('ready-to-show', () => { + this.window.on('unmaximize', () => { + setTimeout(() => { + const bounds = this.window.getBounds(); + bounds.width += 1; + this.window.setBounds(bounds); + bounds.width -= 1; + this.window.setBounds(bounds); + }, 5); + }); + }); + } } public load() {