Skip to content

Commit 46ab5c0

Browse files
author
Benjamin Pasero
committed
1 parent d3066ce commit 46ab5c0

4 files changed

Lines changed: 59 additions & 48 deletions

File tree

src/vs/workbench/browser/web.simpleservices.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,8 @@ export class SimpleWindowsService implements IWindowsService {
661661
}
662662

663663
relaunch(_options: { addArgs?: string[], removeArgs?: string[] }): Promise<void> {
664+
window.location.reload();
665+
664666
return Promise.resolve();
665667
}
666668

src/vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts renamed to src/vs/workbench/contrib/relauncher/common/relauncher.contribution.ts

Lines changed: 55 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
1515
import { RunOnceScheduler } from 'vs/base/common/async';
1616
import { URI } from 'vs/base/common/uri';
1717
import { isEqual } from 'vs/base/common/resources';
18-
import { isMacintosh } from 'vs/base/common/platform';
18+
import { isMacintosh, isNative } from 'vs/base/common/platform';
1919
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
2020
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
2121
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
@@ -57,48 +57,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
5757
private onConfigurationChange(config: IConfiguration, notify: boolean): void {
5858
let changed = false;
5959

60-
// Titlebar style
61-
if (config.window && config.window.titleBarStyle !== this.titleBarStyle && (config.window.titleBarStyle === 'native' || config.window.titleBarStyle === 'custom')) {
62-
this.titleBarStyle = config.window.titleBarStyle;
63-
changed = true;
64-
}
65-
66-
// macOS: Native tabs
67-
if (isMacintosh && config.window && typeof config.window.nativeTabs === 'boolean' && config.window.nativeTabs !== this.nativeTabs) {
68-
this.nativeTabs = config.window.nativeTabs;
69-
changed = true;
70-
}
71-
72-
// macOS: Native fullscreen
73-
if (isMacintosh && config.window && typeof config.window.nativeFullScreen === 'boolean' && config.window.nativeFullScreen !== this.nativeFullScreen) {
74-
this.nativeFullScreen = config.window.nativeFullScreen;
75-
changed = true;
76-
}
77-
78-
// macOS: Click through (accept first mouse)
79-
if (isMacintosh && config.window && typeof config.window.clickThroughInactive === 'boolean' && config.window.clickThroughInactive !== this.clickThroughInactive) {
80-
this.clickThroughInactive = config.window.clickThroughInactive;
81-
changed = true;
82-
}
83-
84-
// Update channel
85-
if (config.update && typeof config.update.mode === 'string' && config.update.mode !== this.updateMode) {
86-
this.updateMode = config.update.mode;
87-
changed = true;
88-
}
89-
90-
// Crash reporter
91-
if (config.telemetry && typeof config.telemetry.enableCrashReporter === 'boolean' && config.telemetry.enableCrashReporter !== this.enableCrashReporter) {
92-
this.enableCrashReporter = config.telemetry.enableCrashReporter;
93-
changed = true;
94-
}
95-
96-
// macOS: Touchbar config
97-
if (isMacintosh && config.keyboard && config.keyboard.touchbar && typeof config.keyboard.touchbar.enabled === 'boolean' && config.keyboard.touchbar.enabled !== this.touchbarEnabled) {
98-
this.touchbarEnabled = config.keyboard.touchbar.enabled;
99-
changed = true;
100-
}
101-
10260
// Tree horizontal scrolling support
10361
if (config.workbench && config.workbench.list && typeof config.workbench.list.horizontalScrolling === 'boolean' && config.workbench.list.horizontalScrolling !== this.treeHorizontalScrolling) {
10462
this.treeHorizontalScrolling = config.workbench.list.horizontalScrolling;
@@ -117,12 +75,63 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
11775
changed = true;
11876
}
11977

78+
if (isNative) {
79+
80+
// Titlebar style
81+
if (config.window && config.window.titleBarStyle !== this.titleBarStyle && (config.window.titleBarStyle === 'native' || config.window.titleBarStyle === 'custom')) {
82+
this.titleBarStyle = config.window.titleBarStyle;
83+
changed = true;
84+
}
85+
86+
// macOS: Native tabs
87+
if (isMacintosh && config.window && typeof config.window.nativeTabs === 'boolean' && config.window.nativeTabs !== this.nativeTabs) {
88+
this.nativeTabs = config.window.nativeTabs;
89+
changed = true;
90+
}
91+
92+
// macOS: Native fullscreen
93+
if (isMacintosh && config.window && typeof config.window.nativeFullScreen === 'boolean' && config.window.nativeFullScreen !== this.nativeFullScreen) {
94+
this.nativeFullScreen = config.window.nativeFullScreen;
95+
changed = true;
96+
}
97+
98+
// macOS: Click through (accept first mouse)
99+
if (isMacintosh && config.window && typeof config.window.clickThroughInactive === 'boolean' && config.window.clickThroughInactive !== this.clickThroughInactive) {
100+
this.clickThroughInactive = config.window.clickThroughInactive;
101+
changed = true;
102+
}
103+
104+
// Update channel
105+
if (config.update && typeof config.update.mode === 'string' && config.update.mode !== this.updateMode) {
106+
this.updateMode = config.update.mode;
107+
changed = true;
108+
}
109+
110+
// Crash reporter
111+
if (config.telemetry && typeof config.telemetry.enableCrashReporter === 'boolean' && config.telemetry.enableCrashReporter !== this.enableCrashReporter) {
112+
this.enableCrashReporter = config.telemetry.enableCrashReporter;
113+
changed = true;
114+
}
115+
116+
// macOS: Touchbar config
117+
if (isMacintosh && config.keyboard && config.keyboard.touchbar && typeof config.keyboard.touchbar.enabled === 'boolean' && config.keyboard.touchbar.enabled !== this.touchbarEnabled) {
118+
this.touchbarEnabled = config.keyboard.touchbar.enabled;
119+
changed = true;
120+
}
121+
}
122+
120123
// Notify only when changed and we are the focused window (avoids notification spam across windows)
121124
if (notify && changed) {
122125
this.doConfirm(
123-
localize('relaunchSettingMessage', "A setting has changed that requires a restart to take effect."),
124-
localize('relaunchSettingDetail', "Press the restart button to restart {0} and enable the setting.", this.envService.appNameLong),
125-
localize('restart', "&&Restart"),
126+
isNative ?
127+
localize('relaunchSettingMessage', "A setting has changed that requires a restart to take effect.") :
128+
localize('relaunchSettingMessageWeb', "A setting has changed that requires a reload to take effect."),
129+
isNative ?
130+
localize('relaunchSettingDetail', "Press the restart button to restart {0} and enable the setting.", this.envService.appNameLong) :
131+
localize('relaunchSettingDetailWeb', "Press the reload button to reload {0} and enable the setting.", this.envService.appNameLong),
132+
isNative ?
133+
localize('restart', "&&Restart") :
134+
localize('restartWeb', "&&Reload"),
126135
() => this.windowsService.relaunch(Object.create(null))
127136
);
128137
}

src/vs/workbench/workbench.main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ import 'vs/workbench/contrib/terminal/browser/terminalQuickOpen';
272272
import 'vs/workbench/contrib/terminal/browser/terminalPanel';
273273

274274
// Relauncher
275-
import 'vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution';
275+
import 'vs/workbench/contrib/relauncher/common/relauncher.contribution';
276276

277277
// Tasks
278278
import 'vs/workbench/contrib/tasks/browser/task.contribution';

src/vs/workbench/workbench.web.main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ registerSingleton(ITerminalNativeService, TerminalNativeService, true);
283283
registerSingleton(ITerminalInstanceService, TerminalInstanceService, true);
284284

285285
// Relauncher
286-
// import 'vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution';
286+
import 'vs/workbench/contrib/relauncher/common/relauncher.contribution';
287287

288288
// Tasks
289289
import 'vs/workbench/contrib/tasks/browser/task.contribution';

0 commit comments

Comments
 (0)