fix: set desktop name on Linux so taskbar uses the correct app icon

Without app.setDesktopName(), the window manager cannot associate the
running Electron process with automaker.desktop. GNOME/KDE fall back to
_NET_WM_ICON which defaults to Electron's own bundled icon.

Calling app.setDesktopName('automaker.desktop') before any window is
created sets the _GTK_APPLICATION_ID hint and XDG app_id so the WM
picks up the desktop entry's Icon for the taskbar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
DhanushSantosh
2026-02-26 18:14:08 +05:30
parent 6a824a9ff0
commit dd7654c254

View File

@@ -53,6 +53,10 @@ if (isDev) {
// Must be set before app.whenReady() — has no effect on macOS/Windows. // Must be set before app.whenReady() — has no effect on macOS/Windows.
if (process.platform === 'linux') { if (process.platform === 'linux') {
app.commandLine.appendSwitch('ozone-platform-hint', 'auto'); app.commandLine.appendSwitch('ozone-platform-hint', 'auto');
// Link the running process to its .desktop file so GNOME/KDE uses the
// desktop entry's Icon for the taskbar instead of Electron's default.
// Must be called before any window is created.
app.setDesktopName('automaker.desktop');
} }
// Register IPC handlers // Register IPC handlers