fix(linux): make WM_CLASS configurable so app icons resolve in GNOME#372
Open
elijah-apprabbit wants to merge 1 commit intoblackboardsh:mainfrom
Open
fix(linux): make WM_CLASS configurable so app icons resolve in GNOME#372elijah-apprabbit wants to merge 1 commit intoblackboardsh:mainfrom
elijah-apprabbit wants to merge 1 commit intoblackboardsh:mainfrom
Conversation
On Linux, gnome-shell resolves a window's taskbar/dock icon by matching the X11 WM_CLASS property against StartupWMClass in installed .desktop files. Electrobun hardcodes WM_CLASS to "ElectrobunKitchenSink-dev" in nativeWrapper.cpp, but the CLI generates .desktop files with StartupWMClass set to config.app.name — a permanent mismatch that causes every Electrobun app to show a generic placeholder icon. This commit: - Adds a process-global g_linux_wm_class in nativeWrapper.cpp with a mutex-protected setter (setLinuxWmClass) exported via extern "C" - Replaces the hardcoded literal in both createX11Window and createGTKWindow with the configurable global - Adds the FFI binding in native.ts and calls it from BrowserWindow.ts at module init, before any window is created - Adds wmClass to BuildConfigType and ElectrobunConfig's linux block - Updates the CLI to write wmClass into build.json (defaulting to config.app.name) and use the same value for .desktop StartupWMClass - Adds no-op stubs on macOS and Windows so the FFI loads on all platforms without platform gating - Adds wmClass example to the kitchen sink config Zero-config fix: existing apps get correct icons automatically because wmClass defaults to config.app.name, which already matches what the CLI writes to StartupWMClass. Apps can override via build.linux.wmClass if they need a custom class. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
First, apologies if I skipped a Contributing doc or missed terms of conduct somewhere, this is my first time contributing to this project and tried my best to follow the standards set. Happy to fix anything or for this to be closed, I just wanted to address an issue that I've faced myself, thank you for an awesome project! :)
On Linux, gnome-shell resolves a window's taskbar/dock icon by matching the X11 WM_CLASS property against StartupWMClass in installed .desktop files. Electrobun hardcodes WM_CLASS to "ElectrobunKitchenSink-dev" in nativeWrapper.cpp, but the CLI generates .desktop files with StartupWMClass set to config.app.name — a permanent mismatch that causes every Electrobun app to show a generic placeholder icon.
This commit:
Zero-config fix: existing apps get correct icons automatically because wmClass defaults to config.app.name, which already matches what the CLI writes to StartupWMClass. Apps can override via build.linux.wmClass if they need a custom class.