Skip to content

Instantly share code, notes, and snippets.

@ci7lus
Last active June 13, 2022 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ci7lus/d33c403d8d7fd4de69ca59befdd0b6a7 to your computer and use it in GitHub Desktop.
Save ci7lus/d33c403d8d7fd4de69ca59befdd0b6a7 to your computer and use it in GitHub Desktop.
Electron Bug Repro
"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!
});
// 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