| ... | ... | @@ -66,6 +66,8 @@ const ROOT_DIR = Path.resolve(__dirname, "../../.."); |
| 66 | 66 | const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL); |
| 67 | 67 | const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)"; |
| 68 | 68 | const APP_USER_MODEL_ID = "com.t3tools.t3code"; |
| 69 | const LINUX_DESKTOP_ENTRY_NAME = isDevelopment ? "t3code-dev.desktop" : "t3code.desktop"; |
| 70 | const LINUX_WM_CLASS = isDevelopment ? "t3code-dev" : "t3code"; |
| 69 | 71 | const USER_DATA_DIR_NAME = isDevelopment ? "t3code-dev" : "t3code"; |
| 70 | 72 | const LEGACY_USER_DATA_DIR_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)"; |
| 71 | 73 | const COMMIT_HASH_PATTERN = /^[0-9a-f]{7,40}$/i; |
| ... | ... | @@ -80,6 +82,9 @@ const DESKTOP_UPDATE_CHANNEL = "latest"; |
| 80 | 82 | const DESKTOP_UPDATE_ALLOW_PRERELEASE = false; |
| 81 | 83 | |
| 82 | 84 | type DesktopUpdateErrorContext = DesktopUpdateState["errorContext"]; |
| 85 | type LinuxDesktopNamedApp = Electron.App & { |
| 86 | setDesktopName?: (desktopName: string) => void; |
| 87 | }; |
| 83 | 88 | |
| 84 | 89 | let mainWindow: BrowserWindow | null = null; |
| 85 | 90 | let backendProcess: ChildProcess.ChildProcess | null = null; |
| ... | ... | @@ -263,6 +268,10 @@ function captureBackendOutput(child: ChildProcess.ChildProcess): void { |
| 263 | 268 | |
| 264 | 269 | initializePackagedLogging(); |
| 265 | 270 | |
| 271 | if (process.platform === "linux") { |
| 272 | app.commandLine.appendSwitch("class", LINUX_WM_CLASS); |
| 273 | } |
| 274 | |
| 266 | 275 | function getDestructiveMenuIcon(): Electron.NativeImage | undefined { |
| 267 | 276 | if (process.platform !== "darwin") return undefined; |
| 268 | 277 | if (destructiveMenuIconCache !== undefined) { |
| ... | ... | @@ -715,6 +724,10 @@ function configureAppIdentity(): void { |
| 715 | 724 | app.setAppUserModelId(APP_USER_MODEL_ID); |
| 716 | 725 | } |
| 717 | 726 | |
| 727 | if (process.platform === "linux") { |
| 728 | (app as LinuxDesktopNamedApp).setDesktopName?.(LINUX_DESKTOP_ENTRY_NAME); |
| 729 | } |
| 730 | |
| 718 | 731 | if (process.platform === "darwin" && app.dock) { |
| 719 | 732 | const iconPath = resolveIconPath("png"); |
| 720 | 733 | if (iconPath) { |