Fix Linux tray tooltip identity (#9709)

Keep the tray tooltip text fixed to the application name on Linux so desktop environments do not treat server changes as tray identity changes. Non-Linux platforms continue to show the current server information.
This commit is contained in:
Kurobac
2026-07-11 11:42:00 +08:00
committed by GitHub
parent 45ab7503e3
commit b6ab428dfc
@@ -97,7 +97,7 @@ public class StatusBarViewModel : MyReactiveObject
_config = AppManager.Instance.Config; _config = AppManager.Instance.Config;
SelectedRouting = new(); SelectedRouting = new();
SelectedServer = new(); SelectedServer = new();
RunningServerToolTipText = "-"; RunningServerToolTipText = GetRunningServerToolTipText("-");
BlSystemProxyPacVisible = Utils.IsWindows(); BlSystemProxyPacVisible = Utils.IsWindows();
BlIsNonWindows = Utils.IsNonWindows(); BlIsNonWindows = Utils.IsNonWindows();
@@ -293,16 +293,21 @@ public class StatusBarViewModel : MyReactiveObject
var running = await ConfigHandler.GetDefaultServer(_config); var running = await ConfigHandler.GetDefaultServer(_config);
if (running != null) if (running != null)
{ {
RunningServerDisplay = RunningServerDisplay = running.GetSummary();
RunningServerToolTipText = running.GetSummary(); RunningServerToolTipText = GetRunningServerToolTipText(RunningServerDisplay);
} }
else else
{ {
RunningServerDisplay = RunningServerDisplay = ResUI.CheckServerSettings;
RunningServerToolTipText = ResUI.CheckServerSettings; RunningServerToolTipText = GetRunningServerToolTipText(RunningServerDisplay);
} }
} }
private string GetRunningServerToolTipText(string serverInfo)
{
return Utils.IsLinux() ? Global.AppName : serverInfo;
}
private async Task RefreshServersMenu() private async Task RefreshServersMenu()
{ {
var lstModel = await AppManager.Instance.ProfileModels(_config.SubIndexId, ""); var lstModel = await AppManager.Instance.ProfileModels(_config.SubIndexId, "");