Fixes for taskbar app

This commit is contained in:
2026-01-24 06:55:59 +00:00
parent f1e3630d1b
commit 675673f026
5 changed files with 68 additions and 0 deletions

View File

@@ -265,6 +265,18 @@ public class LinuxApplication : IDisposable
Console.WriteLine("[LinuxApplication] GTK pre-initialized for WebView support");
}
// Set application name for desktop integration (taskbar, etc.)
// Try to get the name from environment or use executable name
string? appName = Environment.GetEnvironmentVariable("APPIMAGE_NAME");
if (string.IsNullOrEmpty(appName))
{
appName = Path.GetFileNameWithoutExtension(Environment.ProcessPath ?? "MauiApp");
}
string prgName = appName.Replace(" ", "");
GtkNative.g_set_prgname(prgName);
GtkNative.g_set_application_name(appName);
Console.WriteLine($"[LinuxApplication] Set application name: {appName} (prgname: {prgName})");
// Initialize dispatcher
LinuxDispatcher.Initialize();
DispatcherProvider.SetCurrent(LinuxDispatcherProvider.Instance);