javascriptnode.jsuser-interfaceelectronelectron-vue

Electron: Setting the 'fullscreen' flag to false not disabling the fullscreen button on macOS


When creating a new BrowserWindow instance in Electron several flags can be set, one of which being fullscreen.

The description of the flag is the following:

Whether the window should show in fullscreen. When explicitly set to false the fullscreen button will be hidden or disabled on macOS. Default is false.

However, in my experience the window simply moves to the bottom-left of the screen (notice that the button itself is green, too, rather than greyed out).

I have uploaded a GIF displaying this behaviour here. (Stack won't let me upload a large file)

My createWindow declaration reads as such:

mainWindow = new BrowserWindow({
  height: 600,
  width: 600,
  title: 'Registar',
  titleBarStyle: 'hiddenInset',
  show: false,
  resizable: false,
  fullscreen: false,
});

I believe that the resizable flag being set to false may be conflicting with fullscreen, somehow.

I am using the electron-vue boilerplate, which comes with Electron 1.7.5. Updating to 2.0.0 did not resolve this problem. Updating everything (disregarding my package.json) using yarn upgrade --latest.

I am running macOS High Sierra 10.13.4.

If you want any more information please ask.


Solution

  • Set fullscreen to false worked as expected. You can not set window to fullscreen anymore, but it is still maximizable. I think what you need is set maximizable to false.

    enter image description here