Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 0744a85

Browse files
committed
feat(flake): handle StartupWMClass
1 parent e5a6f53 commit 0744a85

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

apps/desktop/electron-forge/forge.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { LOCALES } = require("@triliumnext/commons");
55
const ELECTRON_FORGE_DIR = __dirname;
66

77
const EXECUTABLE_NAME = "trilium"; // keep in sync with server's package.json -> packagerConfig.executableName
8-
const PRODUCT_NAME = "TriliumNext Notes";
8+
const { PRODUCT_NAME } = require("../src/app-info.js");
99
const APP_ICON_PATH = path.join(ELECTRON_FORGE_DIR, "app-icon");
1010

1111
const extraResourcesForPlatform = getExtraResourcesForPlatform();

apps/desktop/src/app-info.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* The Electron product name (can be used for the window WMClass or passed down to the Electron packager).
3+
*/
4+
export const PRODUCT_NAME = "TriliumNext Notes";

apps/desktop/src/electron-main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import options from "@triliumnext/server/src/services/options.js";
88
import electronDebug from "electron-debug";
99
import electronDl from "electron-dl";
1010
import { deferred } from "@triliumnext/server/src/services/utils.js";
11+
import { PRODUCT_NAME } from "./app-info";
1112

1213
async function main() {
1314
const serverInitializedPromise = deferred<void>();
@@ -28,6 +29,7 @@ async function main() {
2829
// Electron 36 crashes with "Using GTK 2/3 and GTK 4 in the same process is not supported" on some distributions.
2930
// See https://github.com/electron/electron/issues/46538 for more info.
3031
if (process.platform === "linux") {
32+
electron.app.setName(PRODUCT_NAME);
3133
electron.app.commandLine.appendSwitch("gtk-version", "3");
3234
}
3335

0 commit comments

Comments
 (0)