Last active
June 13, 2022 08:43
-
-
Save ci7lus/d33c403d8d7fd4de69ca59befdd0b6a7 to your computer and use it in GitHub Desktop.
Electron Bug 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
"use strict"; | |
Object.defineProperty(exports, "__esModule", { value: true }); | |
const promises_1 = require("timers/promises"); | |
const electron_1 = require("electron"); | |
electron_1.app.on("ready", async () => { | |
const browser = new electron_1.BrowserWindow({ | |
titleBarStyle: "hiddenInset", | |
titleBarOverlay: true, | |
}); | |
await (0, promises_1.setTimeout)(1000); | |
browser.setWindowButtonVisibility(false); | |
await (0, promises_1.setTimeout)(1000); | |
browser.setFullScreen(true); | |
await (0, promises_1.setTimeout)(1000); | |
browser.setFullScreen(false); | |
for (const _ of Array(10).keys()) { | |
await (0, promises_1.setTimeout)(1000); | |
browser.setWindowButtonVisibility(true); | |
} | |
// No traffic lights! | |
}); |
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
// https://github.com/vivid-lapin/electron-button-fullscreen-repro/blob/d7c6eb4ba8a3ab8dac7a9c7e38fdaf12e4e01dc9/src/index.ts | |
import { setTimeout } from "timers/promises" | |
import { app, BrowserWindow } from "electron" | |
app.on("ready", async () => { | |
const browser = new BrowserWindow({ | |
titleBarStyle: "hiddenInset", | |
titleBarOverlay: true, | |
}) | |
await setTimeout(1000) | |
browser.setWindowButtonVisibility(false) | |
await setTimeout(1000) | |
browser.setFullScreen(true) | |
await setTimeout(1000) | |
browser.setFullScreen(false) | |
await setTimeout(1000) | |
browser.setWindowButtonVisibility(true) | |
// No traffic lights! | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment