Repository navigation
Set desktopName so Linux launchers match the app's window - #3172
Merged
Merged
Conversation
Electron now derives a window's Wayland app ID and X11 WM_CLASS from the product name, lowercased: "losslesscut" (electron/electron#49988, electron/electron#51424). Without desktopName, electron-builder still writes StartupWMClass=LosslessCut into the AppImage's desktop entry, and warns about it in every Linux build. When the launcher is installed under another file name, as AppImageLauncher does, GNOME then can't link the running window to it, and the dock shows a generic icon. Setting desktopName to the name Electron already defaults to makes electron-builder write StartupWMClass=losslesscut, the value the Flathub desktop file already uses. The app's own app ID and WM_CLASS don't change. Changelog: Linux: docks show LosslessCut's own icon for the AppImage when its launcher is installed under another name (e.g. by AppImageLauncher) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
thanks a lot for the thorough investigation and testing! merged, it'll be in the next nightly build and release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Ubuntu 26.04 (GNOME 50.1, Wayland), LosslessCut 3.69.0's AppImage, integrated by AppImageLauncher, shows a generic icon in the dock instead of its own.
The AppImage's desktop entry says
StartupWMClass=LosslessCut, but the window identifies itself aslosslesscut: Waylandapp_idlosslesscut, X11WM_CLASS"losslesscut", "Losslesscut". Electron now derives both from the product name, lowercased (electron/electron#49988, electron/electron#51424). If the launcher keeps the file namelosslesscut.desktop, GNOME can still match it by file name, but AppImageLauncher installs it asappimagekit_<hash>-LosslessCut.desktop, so onlyStartupWMClasscan link the two.electron-builder warns about this in every Linux build (reason: "desktopName is not set in package.json"): "Without it desktop environments may not link running windows to this .desktop entry. Set desktopName in package.json and linux.syncDesktopName: true to fix."
It probably started with 3.69.0, the first release on Electron 42 (3.68.0 was on Electron 38), but I haven't tested 3.68.0.
Change
Set
"desktopName": "losslesscut.desktop"inpackage.json. electron-builder then writesStartupWMClass=losslesscut, the same valueno.mifi.losslesscut.desktopalready uses for Flathub. Electron already defaults to this name, so the app's own app ID and WM_CLASS don't change.I left out
linux.syncDesktopName: the AppImage's desktop file is already namedlosslesscut.desktop, and I haven't tested what the option changes in the snap.Testing
Ubuntu 26.04, GNOME 50.1, Electron 42.11.15, electron-builder 26.16.1. I built the x64 AppImage from master (
8ae38b7e) with and without the change:losslesscut.desktopfiles differ in one line:StartupWMClass=LosslessCutbecameStartupWMClass=losslesscut. The build's desktopName warning is gone.package.jsonhasdesktopName.app_idlosslesscut; X11 (--ozone-platform=x11)WM_CLASS"losslesscut", "Losslesscut". GNOME tries the WM_CLASS instance againstStartupWMClassfirst (shell-window-tracker.c), so the new value matches on X11 too.Not tested: the snap, other desktops (KDE and others), and the dock with the newly built AppImage installed in place of 3.69.0.
Prepared with help from Claude Code; the commit carries its Co-Authored-By trailer.