BrowserWindow width and height are incorrect

I’m creating a BrowserWindow in my application like so:

function createWindow(): void {
  win = new BrowserWindow({
    width: 1024,
    height: 768,
    webPreferences: {
      webSecurity: !serve,
      nodeIntegration: true
    }
  });

  win.setMenu(null);
  win.center();
  // win.maximize();
}

However, the window created including system chrome is only 1011x763-ish. I saw an issue opened a long time ago for electron 1.x about this, but the issue was closed and I haven’t seen anything since.

We’ll be running our application on Windows machines, mostly Windows 7 and Windows 10. How can I ensure that my application window will actually be 1024x768?

Thank you,
Kyle

Hello @kamcknig,

First, can you tell us more about the electron version and platform you are using ? Maybe a fix was made since.

Secondly, I see that you set the menu to null after your window is shown. Maybe this space is the one of the menu.

Third and last, have you tried resizing the window on runtime? You could use this method at the total end of your program to do it.

Hope I helped.