mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
feat(flake): handle StartupWMClass
This commit is contained in:
parent
e5a6f53f98
commit
0744a85421
@ -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();
|
||||
|
4
apps/desktop/src/app-info.ts
Normal file
4
apps/desktop/src/app-info.ts
Normal 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";
|
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user