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

No csd linux by default #68640

Merged
merged 6 commits into from
Feb 18, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 4 additions & 4 deletions src/vs/platform/windows/common/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { Event } from 'vs/base/common/event';
import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
import { IProcessEnvironment, isMacintosh } from 'vs/base/common/platform';
import { IProcessEnvironment, isMacintosh, isLinux } from 'vs/base/common/platform';
import { ParsedArgs, IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
import { IRecentlyOpened } from 'vs/platform/history/common/history';
Expand Down Expand Up @@ -277,12 +277,12 @@ export function getTitleBarStyle(configurationService: IConfigurationService, en
}

const style = configuration.titleBarStyle;
if (style === 'native') {
return 'native';
if (style === 'native' || style === 'custom') {
return style;
}
}

return 'custom'; // default to custom on all OS
return isLinux ? 'native' : 'custom'; // default to custom on all macOS and Windows
}

export const enum OpenContext {
Expand Down
61 changes: 29 additions & 32 deletions src/vs/workbench/browser/parts/titlebar/menubarControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class MenubarControl extends Disposable {
this.recentlyOpened = recentlyOpened;
});

this.detectAndRecommendCustomTitlebar();
this.notifyExistingLinuxUser();

this.registerListeners();
}
Expand Down Expand Up @@ -190,10 +190,6 @@ export class MenubarControl extends Disposable {
if (this.keys.some(key => event.affectsConfiguration(key))) {
this.updateMenubar();
}

if (event.affectsConfiguration('window.menuBarVisibility')) {
this.detectAndRecommendCustomTitlebar();
}
}

private onRecentlyOpenedChange(): void {
Expand All @@ -203,39 +199,40 @@ export class MenubarControl extends Disposable {
});
}

private detectAndRecommendCustomTitlebar(): void {
// TODO@sbatten remove after feb19
private notifyExistingLinuxUser(): void {
if (!isLinux) {
return;
}

if (!this.storageService.getBoolean('menubar/electronFixRecommended', StorageScope.GLOBAL, false)) {
if (this.currentMenubarVisibility === 'hidden' || this.currentTitlebarStyleSetting === 'custom') {
// Issue will not arise for user, abort notification
return;
}
const isNewUser = !this.storageService.get('telemetry.lastSessionDate', StorageScope.GLOBAL);
const hasBeenNotified = this.storageService.getBoolean('menubar/linuxTitlebarRevertNotified', StorageScope.GLOBAL, false);
const titleBarConfiguration = this.configurationService.inspect('window.titleBarStyle');
if (isNewUser || hasBeenNotified || (titleBarConfiguration && titleBarConfiguration.user)) {
return;
}

const message = nls.localize('menubar.electronFixRecommendation', "If you experience hard to read text in the menu bar, we recommend trying out the custom title bar.");
this.notificationService.prompt(Severity.Info, message, [
{
label: nls.localize('goToSetting', "Open Settings"),
run: () => {
return this.preferencesService.openGlobalSettings(undefined, { query: 'window.titleBarStyle' });
}
},
{
label: nls.localize('moreInfo', "More Info"),
run: () => {
window.open('https://go.microsoft.com/fwlink/?linkid=2038566');
}
},
{
label: nls.localize('neverShowAgain', "Don't Show Again"),
run: () => {
this.storageService.store('menubar/electronFixRecommended', true, StorageScope.GLOBAL);
}
const message = nls.localize('menubar.linuxTitlebarRevertNotification', "We have updated the default title bar on Linux to use the native setting. If you prefer, you can go back to the custom setting ");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbatten why is there a trailing whitespace at the end of the sentence (you can go back to the custom setting )?

this.notificationService.prompt(Severity.Info, message, [
{
label: nls.localize('goToSetting', "Open Settings"),
run: () => {
return this.preferencesService.openGlobalSettings(undefined, { query: 'window.titleBarStyle' });
}
]);
}
},
{
label: nls.localize('moreInfo', "More Info"),
run: () => {
window.open('https://go.microsoft.com/fwlink/?linkid=2074137');
}
},
{
label: nls.localize('neverShowAgain', "Don't Show Again"),
run: () => {
this.storageService.store('menubar/linuxTitlebarRevertNotified', true, StorageScope.GLOBAL);
}
}
]);
}

private registerListeners(): void {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/electron-browser/main.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ configurationRegistry.registerConfiguration({
'window.titleBarStyle': {
'type': 'string',
'enum': ['native', 'custom'],
'default': 'custom',
'default': isLinux ? 'native' : 'custom',
'scope': ConfigurationScope.APPLICATION,
'description': nls.localize('titleBarStyle', "Adjust the appearance of the window title bar. Changes require a full restart to apply.")
},
Expand Down