Application name is not shown in the gnome top bar
See original GitHub issueDescribe the bug
See this image how just the logo (and no name of any kind) is shown when an avalonia app is running on gnome:

(top left in the image, to the right of the avalonia icon there should be some kind of name) I was unable find any info about how to fix that. I tried grabbing:
<NativeMenu.Menu>
<NativeMenu />
</NativeMenu.Menu>
from: https://github.com/VitalElement/Xune/blob/main/Xune.Desktop/App.axaml but that didn’t help at all
To Reproduce Steps to reproduce the behavior:
- Run commands:
dotnet new -i Avalonia.Templates
mkdir MyApp
cd MyApp/
dotnet new avalonia.mvvm
dotnet run
- Look at the top left of the screen and notice how the program name is missing
Expected behavior
I expected at least something like MyApp (which seems to be the executable name generated) to be there, but instead it looks like avalonia tries to use some smarter API to report a different name to gnome but that apparently fails entirely.
If this is a documentation issue rather than a bug, this is still pretty serious (and a pretty big oversight in the templates), and doesn’t look very professional at all. The other times I’ve seen this happen basically have been me messing with a GUI framework and making it accidentally broken.
Screenshots See the first section of this issue
Desktop (please complete the following information):
- OS: Linux (Fedora 35)
- Should be the latest templates version (I just ran the avalonia template install command again). Looks like it puts
0.10.12as the avalonia version in the created MyApp.csproj file
Additional context Problem visible even with the template application.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)

Top Related StackOverflow Question
I’ll close this as https://github.com/AvaloniaUI/Avalonia/pull/8597 is now merged.
I investigated this and it seems that Avalonia doesn’t call
XSetClassHintwhich is what sets that text. Experimentally I put some code intoX11Window.SetIconto just put a test name on the Window, and a bit surprisingly it actually works:Here’s the relevant code:
Note I had to add those class hint function and struct definitions as they didn’t seem to exist yet.
I’ll try to find the right place and attempt to clean up that code a bit, and then I think I could submit a PR.