This commit is contained in:
Khaf 2025-03-18 06:55:29 +01:00 committed by GitHub
commit 2bccce55b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

11
main.js
View File

@ -42,6 +42,17 @@ const obsidian = require("obsidian"),
{ nativeImage, BrowserWindow } = require("electron").remote,
{ getCurrentWindow, globalShortcut } = require("electron").remote;
app.on("second-instance", (e) => {
const win2 = BrowserWindow.getAllWindows()[0];
// prevents "flashing" (quick open->close Obsidian start window)
win2.setOpacity(0.0);
win2.once("ready-to-show", () => {
win2.close();
});
getCurrentWindow().show();
getCurrentWindow().focus();
});
const vaultWindows = new Set(),
maximizedWindows = new Set(),
getWindows = () => [...vaultWindows],