-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application name is not shown in the gnome top bar #7685
Comments
If you mean the one in
and that shows the same issue, the name doesn't appear. |
I investigated this and it seems that Avalonia doesn't call Here's the relevant code: var classHint = XAllocClassHint();
var classHintData = (XClassHint)Marshal.PtrToStructure(classHint, typeof(XClassHint));
var classTextData = Marshal.StringToHGlobalAnsi("test name");
classHintData.ResClass = classTextData;
classHintData.ResName = classTextData;
Marshal.StructureToPtr(classHintData, classHint, true);
XSetClassHint(_x11.Display, _handle, classHint);
XFree(classHint);
Marshal.FreeHGlobal(classTextData); 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. |
I believe we do set Avalonia/src/Avalonia.X11/X11Window.cs Lines 1083 to 1091 in c7c6450
|
If I replace my code change with I based my solution on this StackOverflow answer: https://stackoverflow.com/a/62849688/4371508 which seems to indicate that this special API needs to be used and it is not a normal property that is set like that. So this text that needs to be set is probably unrelated to WM_CLASS. |
I think I can figure out the X11Window class changes that will allow setting the application name, but briefly looking at the way the X11 platform etc. is initialized it doesn't look like I can grab |
I opened a draft PR with a dummy "Avalonia Application" now always being set as the application name: #8595 |
I'll close this as #8597 is now merged. |
Describe 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:
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:
dotnet new -i Avalonia.Templates mkdir MyApp cd MyApp/ dotnet new avalonia.mvvm dotnet run
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):
0.10.12
as the avalonia version in the created MyApp.csproj fileAdditional context
Problem visible even with the template application.
The text was updated successfully, but these errors were encountered: