Skip to content

Commit

Permalink
macos: fix window.titleBarStyle on macOS
Browse files Browse the repository at this point in the history
The commit fixes the `window.titleBarStyle` handling on macOS which would otherwise cause the menu to be completely removed and difficult to recover for users.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed Aug 18, 2022
1 parent 8706ed8 commit 1a7c132
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export class ElectronMenuContribution extends BrowserMenuBarContribution impleme
});
this.preferenceService.onPreferenceChanged(change => {
if (change.preferenceName === 'window.titleBarStyle') {
if (isOSX) {
return; // the `window.titleBarStyle` preference is a no-op on macOS.
}
if (this.titleBarStyleChangeFlag && this.titleBarStyle !== change.newValue && electronRemote.getCurrentWindow().isFocused()) {
electron.ipcRenderer.send(TitleBarStyleChanged, change.newValue);
this.handleRequiredRestart();
Expand Down

0 comments on commit 1a7c132

Please sign in to comment.