Created
March 3, 2023 00:08
-
-
Save PsychoLlama/fcb2790372b6e4957beac9be7e543d3d to your computer and use it in GitHub Desktop.
Electron Overlay Duplicate Dock Icon Repro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { app, BrowserWindow } = require("electron"); | |
async function createWindow() { | |
const win = new BrowserWindow({ | |
width: 600, | |
height: 400, | |
}); | |
win.setVisibleOnAllWorkspaces(true, { | |
// Transforms process type to `UIElementApplication`. | |
visibleOnFullScreen: true, | |
}); | |
await win.loadFile("./plain-window.html"); | |
// Waits 1s, then transforms process type to `ForegroundApplication`. | |
// The timer avoids contention with `dock.hide()` to avoid the same | |
// bug demonstrated here. | |
app.dock.show(); | |
return win; | |
} | |
app.on("ready", async () => { | |
(await createWindow()).close(); | |
(await createWindow()).close(); | |
(await createWindow()).close(); | |
await createWindow(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "duplicate-dock-icon-repro", | |
"productName": "duplicate-dock-icon-repro", | |
"description": "My Electron application description", | |
"keywords": [], | |
"main": "./main.js", | |
"version": "1.0.0", | |
"author": "Jesse Gibson", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"dependencies": {}, | |
"devDependencies": { | |
"electron": "23.1.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Plain Window</title> | |
</head> | |
<body> | |
<p> | |
<em>This page intentionally left blank</em> | |
</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment