Change:
Issue Type: <bBug</bRepro a non default zoom level on MacOS with the window Bug The window title bar has the incorrect height (it should match that of the window control icons) : ! This is fixed after zoom VS Code version: Code - Insiders 1.48.0-insider (, 2020-07-28T10:40:03.139Z) OS version: Darwin x64 19.6.0 <details<summarySystem Info</summary </details<!-- generated by issue reporter --
I've been encountering this for the past week and it's been a bit annoying when you reload and forget your zoom changed. Then when you want to zoom in again it dramatically changes. !
Marking this for July since I expect it to generate a lot of issue reports
This is a regression from the recent zoom change , we now set a default zoom factor on the browser window, when you reload it always seems to take preference over the current zoom level set on the webContents. Most likely a bug in electron, will check.
confirmed the behavior in electron , will have to check if this is intended or a bug.
Talked to he will bring in the fix in Electron.
After a bit more investigation the issue is not in electron, we are using the wrong api to set persistent zoom levels. There are 3 different ways to set zoom level for a page. 1) Setting option on the constructor This will be the default zoom level for a page if set 2) using api This is the renderer side api available to set the zoom levels, but a thing to not here is webFrame api are only meant to make changes for the current frame. So if a navigation occurs these values will not be persisted. In short these can be treated as temporary zoom levels. 3) using api This only difference from 2) in that the values set through this api will be persisted across navigations or restarts on a origin basis similar to how zoom works in the browser domain. When an app quits if there is any persistent zoom level during its lifetime, it will be written to file under the user data dir. So next time an app starts it will be applied, but if 1) is set then it will take precedence over the persisted preference value. Order of precedence when app starts: persisted preference value < BrowserWindow zoom factor option < webContents/webFrame zoom api
reverting looks like a nightmare, I will push a minimal fix for the issue.
It is not clear to me why this caused issues. Given my change and yours, it looks like we are now setting both on the browser window and on the frame. Is the issue that upon reload the browser window is not applied anymore? The intent of my change was to reduce sync IPC on startup, so maybe there is a way to configure this all from ?
No its the other way, on reload the browser window zoomfactor take effect, because we use zoom apis to set zoom level in the editor, values set via this api are temporary (i-e) will not be preserved across navigations has context as to why. The ideal fix here would be to use zoom api in electron-main which are permanent and will be applied across navigations.
another intent of my change was to reduce zoom flicker by applying the zoom level before the window is created, I often see our splash screen appearing in non-zoomed state and then zooming in, but maybe that issue is fixed by the being set on the browser window now. How would it work if we set zoom in ? What if the user changes the zoom level from within VSCode, would it not have to then go back to to update it? Maybe easier to discuss in our 1on1.
yup lets discuss this in the call

Discussion:
}(this, function () { const preloadGlobals = globals(); const sandbox = preloadGlobals.context.sandbox; <ins> const webFrame = preloadGlobals.webFrame; </ins> const safeProcess = sandbox ? preloadGlobals.process : process; /**

/** * // configuration: INativeWindowConfiguration * @type {{ <ins> * zoomLevel?: number, </ins> * extensionDevelopmentPath?: string[], * extensionTestsPath?: string, * userEnv?: { [key: string]: string | undefined },

* }} */ const configuration = JSON.parse(args['config'] || '{}') || {}; <ins> // Apply zoom level early to avoid glitches const zoomLevel = configuration.zoomLevel; if (typeof zoomLevel === 'number' && zoomLevel !== 0) { webFrame.setZoomLevel(zoomLevel); } </ins> // Error handler safeProcess.on('uncaughtException', function (error) { onUnexpectedError(error, enableDeveloperTools);