Skip to content

Commit

Permalink
Switching to simple full screen produces a jump (fix #99039)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Jun 3, 2020
1 parent 595d2b9 commit 7fe821d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion scripts/code-cli.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ if not exist out yarn compile
set ELECTRON_RUN_AS_NODE=1
set NODE_ENV=development
set VSCODE_DEV=1
REM set ELECTRON_DEFAULT_ERROR_MODE=1 TODO@ben to investigate if this helps with builds reporting stacks if renderer crashes
set ELECTRON_ENABLE_LOGGING=1
set ELECTRON_ENABLE_STACK_DUMPING=1

Expand Down
1 change: 0 additions & 1 deletion scripts/code.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if not exist out yarn compile
set NODE_ENV=development
set VSCODE_DEV=1
set VSCODE_CLI=1
REM set ELECTRON_DEFAULT_ERROR_MODE=1 TODO@ben to investigate if this helps with builds reporting stacks if renderer crashes
set ELECTRON_ENABLE_LOGGING=1
set ELECTRON_ENABLE_STACK_DUMPING=1
set VSCODE_LOGS=
Expand Down
20 changes: 17 additions & 3 deletions src/vs/code/electron-main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,27 @@ export class CodeWindow extends Disposable implements ICodeWindow {
this.setFullScreen(false);
this.setFullScreen(true);
}
}, 100));

const displayChangedListener = () => {

// Fix simple-fullscreen visuals
simpleFullScreenScheduler.schedule();

// Notify renderers
this.sendWhenReady('vscode:displayChanged');
}, 100));
};

const displayChangedListener = () => simpleFullScreenScheduler.schedule();
screen.on('display-metrics-changed', (event, display, changedMetrics) => {
if (changedMetrics.length === 1 && changedMetrics[0] === 'workArea') {
// Electron will emit 'display-metrics-changed' events even when actually
// going fullscreen, because the dock hides. However, we do not want to
// react on this event as there is no change in display bounds.
return;
}

screen.on('display-metrics-changed', displayChangedListener);
displayChangedListener();
});
this._register(toDisposable(() => screen.removeListener('display-metrics-changed', displayChangedListener)));

screen.on('display-added', displayChangedListener);
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/electron-browser/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export class NativeWindow extends Disposable {
this.notificationService.info(message);
});

// Display change events
ipcRenderer.on('vscode:displayChanged', () => {
clearAllFontInfos();
});
Expand Down

0 comments on commit 7fe821d

Please sign in to comment.