diff options
Diffstat (limited to 'src/vs/platform/native/electron-main/nativeHostMainService.ts')
-rw-r--r-- | src/vs/platform/native/electron-main/nativeHostMainService.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vs/platform/native/electron-main/nativeHostMainService.ts b/src/vs/platform/native/electron-main/nativeHostMainService.ts index ac91aa14727..c167d9011a9 100644 --- a/src/vs/platform/native/electron-main/nativeHostMainService.ts +++ b/src/vs/platform/native/electron-main/nativeHostMainService.ts @@ -19,6 +19,7 @@ import { URI } from 'vs/base/common/uri'; import { realpath } from 'vs/base/node/extpath'; import { virtualMachineHint } from 'vs/base/node/id'; import { Promises, SymlinkSupport } from 'vs/base/node/pfs'; +import { findFreePort } from 'vs/base/node/ports'; import { MouseInputEvent } from 'vs/base/parts/sandbox/common/electronTypes'; import { localize } from 'vs/nls'; import { ISerializableCommandAction } from 'vs/platform/action/common/action'; @@ -211,6 +212,20 @@ export class NativeHostMainService extends Disposable implements INativeHostMain } } + async updateTitleBarOverlay(windowId: number | undefined, backgroundColor: string, foregroundColor: string): Promise<void> { + if (!isWindows) { + return; // Windows only + } + + const window = this.windowById(windowId); + if (window?.win) { + window.win.setTitleBarOverlay({ + color: backgroundColor, + symbolColor: foregroundColor + }); + } + } + async focusWindow(windowId: number | undefined, options?: { windowId?: number; force?: boolean }): Promise<void> { if (options && typeof options.windowId === 'number') { windowId = options.windowId; @@ -736,6 +751,10 @@ export class NativeHostMainService extends Disposable implements INativeHostMain } } + findFreePort(windowId: number | undefined, startPort: number, giveUpAfter: number, timeout: number, stride = 1): Promise<number> { + return findFreePort(startPort, giveUpAfter, timeout, stride); + } + //#endregion |