|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 |
| -import { app, BrowserWindow, BrowserWindowConstructorOptions, Display, Event, nativeImage, NativeImage, Rectangle, screen, SegmentedControlSegment, systemPreferences, TouchBar, TouchBarSegmentedControl } from 'electron'; |
| 6 | +import { app, BrowserWindow, BrowserWindowConstructorOptions, Display, Event, nativeImage, NativeImage, Point, Rectangle, screen, SegmentedControlSegment, systemPreferences, TouchBar, TouchBarSegmentedControl } from 'electron'; |
7 | 7 | import { RunOnceScheduler } from 'vs/base/common/async';
|
8 | 8 | import { CancellationToken } from 'vs/base/common/cancellation';
|
9 | 9 | import { toErrorMessage } from 'vs/base/common/errorMessage';
|
@@ -141,6 +141,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
141 | 141 | private documentEdited: boolean | undefined;
|
142 | 142 |
|
143 | 143 | private customTrafficLightPosition: boolean | undefined;
|
| 144 | + private defaultTrafficLightPosition: Point | undefined; |
144 | 145 |
|
145 | 146 | private readonly whenReadyCallbacks: { (window: ICodeWindow): void }[] = [];
|
146 | 147 |
|
@@ -1325,9 +1326,14 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
1325 | 1326 |
|
1326 | 1327 | const useCustomTrafficLightPosition = this.configurationService.getValue<boolean>(commandCenterSettingKey);
|
1327 | 1328 | if (useCustomTrafficLightPosition) {
|
1328 |
| - this._win.setTrafficLightPosition({ x: 7, y: 9 }); |
| 1329 | + if (!this.defaultTrafficLightPosition) { |
| 1330 | + this.defaultTrafficLightPosition = this._win.getTrafficLightPosition(); // remember default to restore later |
| 1331 | + } |
| 1332 | + this._win.setTrafficLightPosition({ x: 7, y: 10 }); |
1329 | 1333 | } else {
|
1330 |
| - this._win.setTrafficLightPosition({ x: 7, y: 6 }); |
| 1334 | + if (this.defaultTrafficLightPosition) { |
| 1335 | + this._win.setTrafficLightPosition(this.defaultTrafficLightPosition); |
| 1336 | + } |
1331 | 1337 | }
|
1332 | 1338 |
|
1333 | 1339 | this.customTrafficLightPosition = useCustomTrafficLightPosition;
|
|
0 commit comments