mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 04:16:17 +01:00 
			
		
		
		
	feat(flake): handle StartupWMClass
This commit is contained in:
		@@ -5,7 +5,7 @@ const { LOCALES } = require("@triliumnext/commons");
 | 
				
			|||||||
const ELECTRON_FORGE_DIR = __dirname;
 | 
					const ELECTRON_FORGE_DIR = __dirname;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const EXECUTABLE_NAME = "trilium"; // keep in sync with server's package.json -> packagerConfig.executableName
 | 
					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 APP_ICON_PATH = path.join(ELECTRON_FORGE_DIR, "app-icon");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const extraResourcesForPlatform = getExtraResourcesForPlatform();
 | 
					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 electronDebug from "electron-debug";
 | 
				
			||||||
import electronDl from "electron-dl";
 | 
					import electronDl from "electron-dl";
 | 
				
			||||||
import { deferred } from "@triliumnext/server/src/services/utils.js";
 | 
					import { deferred } from "@triliumnext/server/src/services/utils.js";
 | 
				
			||||||
 | 
					import { PRODUCT_NAME } from "./app-info";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function main() {
 | 
					async function main() {
 | 
				
			||||||
    const serverInitializedPromise = deferred<void>();
 | 
					    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.
 | 
					    // 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.
 | 
					    // See https://github.com/electron/electron/issues/46538 for more info.
 | 
				
			||||||
    if (process.platform === "linux") {
 | 
					    if (process.platform === "linux") {
 | 
				
			||||||
 | 
					        electron.app.setName(PRODUCT_NAME);
 | 
				
			||||||
        electron.app.commandLine.appendSwitch("gtk-version", "3");
 | 
					        electron.app.commandLine.appendSwitch("gtk-version", "3");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user