<p dir="auto"><strong>Edit: I'm guessing this is known and just unavoidable without some extra working around using the resolution of the promise returned from <code class="notranslate">dock.show()</code>?</strong></p>
<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong> <code class="notranslate">7.1.9</code></li>
<li><strong>Operating System:</strong> <code class="notranslate">macOS 10.13.6</code></li>
<li><strong>Last Known Working Electron version:</strong> `Unk</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Duplicate app icons shouldn't be possible.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Duplicate icons can accumulate. After quitting the application the extra icons remain and cannot be quit or force quit to get rid of them. Oddly, simply left-clicking them does get them to go away.</p>
<h3 dir="auto">To Reproduce</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  remote.app.dock.show();
  setTimeout(remote.app.dock.hide, 50);
  setTimeout(remote.app.dock.show, 100);
  setTimeout(remote.app.dock.hide, 150);
  setTimeout(remote.app.dock.show, 200);
  setTimeout(remote.app.dock.hide, 250);"><pre class="notranslate">  <span class="pl-s1">remote</span><span class="pl-kos">.</span><span class="pl-c1">app</span><span class="pl-kos">.</span><span class="pl-c1">dock</span><span class="pl-kos">.</span><span class="pl-en">show</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">remote</span><span class="pl-kos">.</span><span class="pl-c1">app</span><span class="pl-kos">.</span><span class="pl-c1">dock</span><span class="pl-kos">.</span><span class="pl-c1">hide</span><span class="pl-kos">,</span> <span class="pl-c1">50</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">remote</span><span class="pl-kos">.</span><span class="pl-c1">app</span><span class="pl-kos">.</span><span class="pl-c1">dock</span><span class="pl-kos">.</span><span class="pl-c1">show</span><span class="pl-kos">,</span> <span class="pl-c1">100</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">remote</span><span class="pl-kos">.</span><span class="pl-c1">app</span><span class="pl-kos">.</span><span class="pl-c1">dock</span><span class="pl-kos">.</span><span class="pl-c1">hide</span><span class="pl-kos">,</span> <span class="pl-c1">150</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">remote</span><span class="pl-kos">.</span><span class="pl-c1">app</span><span class="pl-kos">.</span><span class="pl-c1">dock</span><span class="pl-kos">.</span><span class="pl-c1">show</span><span class="pl-kos">,</span> <span class="pl-c1">200</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">remote</span><span class="pl-kos">.</span><span class="pl-c1">app</span><span class="pl-kos">.</span><span class="pl-c1">dock</span><span class="pl-kos">.</span><span class="pl-c1">hide</span><span class="pl-kos">,</span> <span class="pl-c1">250</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<blockquote>
<p dir="auto">Note: <code class="notranslate">remote</code> not required, just easier</p>
</blockquote>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">If a user tries to force quit a zombie icon, macOS will prevent re-opening the app without the user acknowledging that it crashed last time, as it would if you actually force quit the app.</p>
<p dir="auto">This should be easy enough for users to workaround, but I assume this isn't the intended behavior.</p>
<p dir="auto">Edit: Simply checking for <code class="notranslate">!dock.isVisible()</code> before calling <code class="notranslate">dock.show()</code> is insufficient to prevent this behavior. The bug persists</p>
<p dir="auto">The real world situation for this is an application that hides/shows with a global hotkey - a user may hit the hotkey by accident and then again to hide it, but they may end up with duplicated dock icons because of this quick action. I toggle back and forth 3x in the repro code above to ensure reproduction, but it can be reproduced with less.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6835891/72575960-398fcb00-389c-11ea-8a16-9f06309965b3.png"><img src="https://user-images.githubusercontent.com/6835891/72575960-398fcb00-389c-11ea-8a16-9f06309965b3.png" alt="image" style="max-width: 100%;"></a></p>
<ul dir="auto">
<li>Output of <code class="notranslate">node_modules/.bin/electron --version</code>: 3.0.0</li>
<li>Operating System (Platform and Version): Debian GNU/Linux 9 (stretch)</li>
<li>Output of <code class="notranslate">node_modules/.bin/electron --version</code> on last known working Electron version (if applicable): (will check and update)</li>
</ul>
<p dir="auto"><strong>Expected Behavior</strong><br>
Should load the index.html page as per the documentation for getting started with electron.</p>
<p dir="auto"><strong>Actual behavior</strong><br>
Shows a transparent application with screenshot of the background.</p>
<p dir="auto"><strong>To Reproduce</strong></p>
<ul dir="auto">
<li>Follow the exact steps for electron-quick-start<br>
You can fork <a href="https://github.com/electron/electron-quick-start">electron-quick-start</a> and include a link to the branch with your changes.</li>
</ul>
<p dir="auto">If you provide a URL, please list the commands required to clone/setup/run your repo e.g.<br>
<strong>Screenshots</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5779016/46390072-968d5f00-c6f3-11e8-8098-5ab19052d2bc.png"><img src="https://user-images.githubusercontent.com/5779016/46390072-968d5f00-c6f3-11e8-8098-5ab19052d2bc.png" alt="electron" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Additional Information</strong><br>
On an related or unrelated note, <code class="notranslate">npm install -g electron</code> fails with even <code class="notranslate">sudo</code> during creation of folder '.electron' in the '/usr/lib/node_modules/electron'.</p>