Use desktopName from package.json for StartupWMClass in Linux desktop entries#9574
Use desktopName from package.json for StartupWMClass in Linux desktop entries#9574
Conversation
|
… entry When desktopName is set in package.json, use it (with .desktop extension stripped) as the StartupWMClass value in the generated desktop entry file. This ensures the WM_CLASS matches Electron's app_id, which is also derived from desktopName, allowing desktop environments to properly associate windows with their desktop entries. Falls back to productName when desktopName is not set. Fixes #7159 Co-authored-by: mmaietta <5238867+mmaietta@users.noreply.github.com>
|
@copilot rebase this PR |
I'm unable to rebase this PR because rebasing requires force pushing, which I don't have the ability to do. Could you rebase it manually, or alternatively, I can recreate the changes on top of the latest base branch if you'd prefer. |
Electron derives
app_idfromdesktopNameinpackage.json, but electron-builder was hardcodingStartupWMClasstoproductName. This mismatch prevents desktop environments from associating windows with their.desktopentry (wrong icons, missing taskbar integration, etc.).For example, Signal Desktop has
desktopName: "signal.desktop",productName: "Signal", andexecutableName: "signal-desktop"— three different values whereStartupWMClassandapp_idmust agree.Changes
options/metadata.ts— AdddesktopNameto theMetadatainterfaceLinuxTargetHelper.ts— ReaddesktopNamefrom package.json, strip.desktopsuffix, and use asStartupWMClass. Falls back toproductNamewhen unset (backward compatible)desktopName: "signal.desktop"producesStartupWMClass=signalOriginal prompt
desktopNameis ignored when generating desktop entry #9103💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.