Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable wco on macOS #239666

Merged
merged 5 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/vs/platform/window/common/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ export function getTitleBarStyle(configurationService: IConfigurationService): T
export const DEFAULT_CUSTOM_TITLEBAR_HEIGHT = 35; // includes space for command center

export function useWindowControlsOverlay(configurationService: IConfigurationService): boolean {
if (isMacintosh || isWeb) {
return false; // only supported on a Windows/Linux desktop instances
if (isWeb) {
return false; // only supported on desktop instances
}

if (hasNativeTitlebar(configurationService)) {
return false; // only supported when title bar is custom
}

if (isLinux) {
if (isLinux || isMacintosh) {
const setting = configurationService.getValue('window.experimentalControlOverlay');
if (typeof setting === 'boolean') {
return setting;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/platform/windows/electron-main/windowImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export abstract class BaseWindow extends Disposable implements IBaseWindow {
}

// Windows/Linux: window control overlay (WCO)
if (this.hasWindowControlOverlay) {
if (this.hasWindowControlOverlay && !isMacintosh) {
win.setTitleBarOverlay({
color: options.backgroundColor?.trim() === '' ? undefined : options.backgroundColor,
symbolColor: options.foregroundColor?.trim() === '' ? undefined : options.foregroundColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
private readonly nativeTabs = new ChangeObserver('boolean');
private readonly nativeFullScreen = new ChangeObserver('boolean');
private readonly clickThroughInactive = new ChangeObserver('boolean');
private readonly linuxWindowControlOverlay = new ChangeObserver('boolean');
private readonly windowControlOverlay = new ChangeObserver('boolean');
private readonly updateMode = new ChangeObserver('string');
private accessibilitySupport: 'on' | 'off' | 'auto' | undefined;
private readonly workspaceTrustEnabled = new ChangeObserver('boolean');
Expand Down Expand Up @@ -120,7 +120,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
processChanged(isMacintosh && this.clickThroughInactive.handleChange(config.window?.clickThroughInactive));

// Linux: WCO
processChanged(isLinux && this.linuxWindowControlOverlay.handleChange(config.window?.experimentalControlOverlay));
processChanged((isLinux || isMacintosh) && this.windowControlOverlay.handleChange(config.window?.experimentalControlOverlay));

// Update mode
processChanged(this.updateMode.handleChange(config.update?.mode));
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/electron-sandbox/desktop.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ import { LinuxCustomTitlebarExperiment } from './parts/titlebar/titlebarPart.js'
},
'window.experimentalControlOverlay': {
'type': 'boolean',
'included': isLinux,
'markdownDescription': localize('window.experimentalControlOverlay', "Show the native window controls when {0} is set to `custom` (Linux only).", '`#window.titleBarStyle#`'),
'included': isLinux || isMacintosh,
'markdownDescription': localize('window.experimentalControlOverlay', "Show the native window controls when {0} is set to `custom` (Linux and MacOS only).", '`#window.titleBarStyle#`'),
'default': true,
'scope': ConfigurationScope.APPLICATION,
},
Expand Down
Loading