feat(flake): handle StartupWMClass

This commit is contained in:
Elian Doran 2025-06-19 15:34:09 +03:00
parent e5a6f53f98
commit 0744a85421
No known key found for this signature in database
3 changed files with 7 additions and 1 deletions

View File

@ -5,7 +5,7 @@ const { LOCALES } = require("@triliumnext/commons");
const ELECTRON_FORGE_DIR = __dirname;
const EXECUTABLE_NAME = "trilium"; // keep in sync with server's package.json -> packagerConfig.executableName
const PRODUCT_NAME = "TriliumNext Notes";
const { PRODUCT_NAME } = require("../src/app-info.js");
const APP_ICON_PATH = path.join(ELECTRON_FORGE_DIR, "app-icon");
const extraResourcesForPlatform = getExtraResourcesForPlatform();

View File

@ -0,0 +1,4 @@
/**
* The Electron product name (can be used for the window WMClass or passed down to the Electron packager).
*/
export const PRODUCT_NAME = "TriliumNext Notes";

View File

@ -8,6 +8,7 @@ import options from "@triliumnext/server/src/services/options.js";
import electronDebug from "electron-debug";
import electronDl from "electron-dl";
import { deferred } from "@triliumnext/server/src/services/utils.js";
import { PRODUCT_NAME } from "./app-info";
async function main() {
const serverInitializedPromise = deferred<void>();
@ -28,6 +29,7 @@ async function main() {
// Electron 36 crashes with "Using GTK 2/3 and GTK 4 in the same process is not supported" on some distributions.
// See https://github.com/electron/electron/issues/46538 for more info.
if (process.platform === "linux") {
electron.app.setName(PRODUCT_NAME);
electron.app.commandLine.appendSwitch("gtk-version", "3");
}