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

window - still allow to restore multiple simple fullscreen windows on same display #158390

Merged
merged 1 commit into from Aug 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/vs/platform/windows/electron-main/windowsStateHandler.ts
Expand Up @@ -146,7 +146,8 @@ export class WindowsStateHandler extends Disposable {
private saveWindowsState(): void {

// TODO@electron workaround for Electron not being able to restore
// multiple fullscreen windows on the same display at once on macOS.
// multiple (native) fullscreen windows on the same display at once
// on macOS.
// https://github.com/electron/electron/issues/34367
const displaysWithFullScreenWindow = new Set<number | undefined>();

Expand Down Expand Up @@ -179,7 +180,7 @@ export class WindowsStateHandler extends Disposable {

if (currentWindowsState.lastPluginDevelopmentHostWindow.uiState.mode === WindowMode.Fullscreen) {
if (displaysWithFullScreenWindow.has(currentWindowsState.lastPluginDevelopmentHostWindow.uiState.display)) {
if (isMacintosh) {
if (isMacintosh && !extensionHostWindow.win?.isSimpleFullScreen()) {
currentWindowsState.lastPluginDevelopmentHostWindow.uiState.mode = WindowMode.Normal;
}
} else {
Expand All @@ -199,7 +200,7 @@ export class WindowsStateHandler extends Disposable {

if (windowState.uiState.mode === WindowMode.Fullscreen) {
if (displaysWithFullScreenWindow.has(windowState.uiState.display)) {
if (isMacintosh && windowState.windowId !== currentWindowsState.lastActiveWindow?.windowId) {
if (isMacintosh && windowState.windowId !== currentWindowsState.lastActiveWindow?.windowId && !window.win?.isSimpleFullScreen()) {
windowState.uiState.mode = WindowMode.Normal;
}
} else {
Expand Down