Skip to content

Match Linux development window icons#130

Draft
SRWieZ wants to merge 3 commits into
NativePHP:mainfrom
SRWieZ:agent/linux-dev-desktop-identity
Draft

Match Linux development window icons#130
SRWieZ wants to merge 3 commits into
NativePHP:mainfrom
SRWieZ:agent/linux-dev-desktop-identity

Conversation

@SRWieZ

@SRWieZ SRWieZ commented Jul 18, 2026

Copy link
Copy Markdown
Member

What changed

Give Linux apps launched by native:run a stable development desktop identity and a matching hidden XDG desktop entry.

  • derive a project-scoped identity from the configured app ID and checkout path
  • set Electron's development-only desktopName before launch
  • write a matching hidden entry under $XDG_DATA_HOME/applications (falling back to ~/.local/share/applications)
  • use the same identity for the desktop filename and StartupWMClass
  • point the entry at the application's development icon

Why

Linux shells resolve a running window's taskbar or dock icon through its desktop identity. Electron otherwise uses the development package name, which has no application-specific desktop entry, so the window may show a generic icon while the tray uses the application's icon.

Electron reads desktopName before creating the app and exposes it as the Wayland app ID and X11 WM class. The matching desktop entry follows the freedesktop convention used by KDE, GNOME, and other compliant desktops.

Coexistence and DX

Development never reuses the production desktop ID. Its identity includes a nativephp-dev marker and a checkout-path hash, so production builds and parallel checkouts remain separate. The entry is hidden from launchers, refreshed atomically on later runs, and failure to write it only emits a warning. macOS, Windows, and production builds are unchanged.

Validation

  • verified with DevKeepr on KDE Wayland: KWin reports matching resourceClass and desktopFileName
  • PHP: 120 tests / 339 assertions
  • PHPStan and Pint pass
  • Electron helper: 6 tests pass
  • full Electron suite: 23/24 pass while DevKeepr is running; the remaining port assertion expects the occupied development port 4000
  • TypeScript plugin build passes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant