<ul dir="auto">
<li>Electron version: 1.4.4</li>
<li>Operating system: Windows 10 Pro (x64)</li>
</ul>
<p dir="auto">I created a new BrowserWindow and set set <strong>fullscreen</strong> to <em>true</em> and <strong>show</strong> to <em>false</em>, then I used<br>
<code class="notranslate">win.once('ready-to-show', () =&gt; { win.show(); });</code><br>
to show the window and window showed as expected<br>
however when I tried to  set <strong>fullscreen</strong> to <em>false</em> the window turned black and completly unresponsive and I had to end process using task manager.</p>
<p dir="auto">setting set <strong>fullscreen</strong> to <em>false</em> and adding <code class="notranslate">win.setFullScreen(true)</code> after <code class="notranslate">win.show();</code> solves the issue.<br>
but I would like to avoid the full screen flashing at the start of my application.</p>
<h1 dir="auto">main.js</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const {app, BrowserWindow} = require('electron');
let win
function createWindow () {
  win = new BrowserWindow({fullscreen: true, fullscreenable: true, show: false, width: 1024, height: 768, title: &quot;My Window&quot;, minWidth: 1024, minHeight: 768})
  global.mainWin = win;

  win.setMenuBarVisibility(false);

  win.once('ready-to-show', () =&gt; {
    win.show();
  });

  win.loadURL(`file://${__dirname}/index.html`)

  win.on('closed', () =&gt; {
    win = null
  })
}

app.on('ready', createWindow)

app.on('window-all-closed', () =&gt; {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () =&gt; {
  if (win === null) {
    createWindow()
  }
})"><pre class="notranslate"><code class="notranslate">const {app, BrowserWindow} = require('electron');
let win
function createWindow () {
  win = new BrowserWindow({fullscreen: true, fullscreenable: true, show: false, width: 1024, height: 768, title: "My Window", minWidth: 1024, minHeight: 768})
  global.mainWin = win;

  win.setMenuBarVisibility(false);

  win.once('ready-to-show', () =&gt; {
    win.show();
  });

  win.loadURL(`file://${__dirname}/index.html`)

  win.on('closed', () =&gt; {
    win = null
  })
}

app.on('ready', createWindow)

app.on('window-all-closed', () =&gt; {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () =&gt; {
  if (win === null) {
    createWindow()
  }
})
</code></pre></div>
<h1 dir="auto">index.html</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;script src=&quot;main_script.js&quot; charset=&quot;UTF-8&quot;&gt; &lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;main_style.css&quot;&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;

   &lt;input type=&quot;button&quot; class=&quot;mainmenu&quot; value=&quot;Toggle Fullscreen&quot; onClick=&quot;FSToggle();&quot;/&gt;

&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;"><pre class="notranslate"><code class="notranslate">&lt;html&gt;
&lt;head&gt;
&lt;meta charset="UTF-8"&gt;
&lt;script src="main_script.js" charset="UTF-8"&gt; &lt;/script&gt;
&lt;link rel="stylesheet" href="main_style.css"&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;div class="container"&gt;

   &lt;input type="button" class="mainmenu" value="Toggle Fullscreen" onClick="FSToggle();"/&gt;

&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre></div>
<h1 dir="auto">main_script.js</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const remote = require('electron').remote;
const win = remote.getGlobal('mainWin');

function FSToggle(){
win.setFullScreen(!win.isFullScreen());
}"><pre class="notranslate"><code class="notranslate">const remote = require('electron').remote;
const win = remote.getGlobal('mainWin');

function FSToggle(){
win.setFullScreen(!win.isFullScreen());
}
</code></pre></div>
<ul dir="auto">
<li>Electron version: 1.2.0, 1.2.1, 1.2.2</li>
<li>Operating system: Windows</li>
</ul>
<p dir="auto">If you start an browser window in fullscreen and then attempt to toggle to windowed mode, the window will just black out and become unresponsive. Attempting to toggle back again still results in a black screen.</p>
<p dir="auto">However, if you start the window in windowed mode and then toggle to fullscreen, it works as expected.</p>
<p dir="auto">This maybe related to the fixes made to the fullscreen API in 1.2.x. It only occurs on Windows. It does not happen on 1.1.3.</p>
<p dir="auto">You can reproduce easily with the <code class="notranslate">electron-api-demos</code> application and 1.2.2.<br>
<a href="https://github.com/electron/electron-api-demos">https://github.com/electron/electron-api-demos</a></p>
<p dir="auto">Update <code class="notranslate">window-options</code> to set <code class="notranslate">fullscreen: true</code><br>
<a href="https://github.com/electron/electron-api-demos/blob/master/main.js#L22">https://github.com/electron/electron-api-demos/blob/master/main.js#L22</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var windowOptions = {
      width: 1080,
      minWidth: 680,
      height: 840,
      title: app.getName(),
      fullscreen: true
    }"><pre class="notranslate"><code class="notranslate">var windowOptions = {
      width: 1080,
      minWidth: 680,
      height: 840,
      title: app.getName(),
      fullscreen: true
    }
</code></pre></div>
<p dir="auto">Start the application and hit F11 to switch to windowed mode and you'll get a black screen.</p>