From 7dfe34301acd099cd9eb4d0796197806e9a67eb7 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 26 Sep 2016 10:53:00 +0200 Subject: [PATCH] toggle fullscreen class for #12377 --- src/vs/code/electron-main/window.ts | 9 +++++++++ src/vs/workbench/electron-browser/integration.ts | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 6a46c5dacf7..70ac020d5ed 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -323,6 +323,15 @@ export class VSCodeWindow { this._lastFocusTime = Date.now(); }); + // Window Fullscreen + this._win.on('enter-full-screen', () => { + this.sendWhenReady('vscode:enterFullScreen'); + }); + + this._win.on('leave-full-screen', () => { + this.sendWhenReady('vscode:leaveFullScreen'); + }); + // Window Failed to load this._win.webContents.on('did-fail-load', (event: Event, errorCode: string, errorDescription: string) => { console.warn('[electron event]: fail to load, ', errorDescription); diff --git a/src/vs/workbench/electron-browser/integration.ts b/src/vs/workbench/electron-browser/integration.ts index de6f627419e..6c89e7bc09f 100644 --- a/src/vs/workbench/electron-browser/integration.ts +++ b/src/vs/workbench/electron-browser/integration.ts @@ -129,6 +129,19 @@ export class ElectronIntegration { this.toggleAutoSave(); }); + // Fullscreen Events + ipc.on('vscode:enterFullScreen', (event) => { + this.partService.joinCreation().then(() => { + this.partService.addClass('fullscreen'); + }); + }); + + ipc.on('vscode:leaveFullScreen', (event) => { + this.partService.joinCreation().then(() => { + this.partService.removeClass('fullscreen'); + }); + }); + // Ensure others can listen to zoom level changes browser.setZoomLevel(webFrame.getZoomLevel()); -- GitLab