From b6ab428dfccd7a2b68f08b3af468763bcab949de Mon Sep 17 00:00:00 2001 From: Kurobac Date: Sat, 11 Jul 2026 11:42:00 +0800 Subject: [PATCH] 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. --- .../ServiceLib/ViewModels/StatusBarViewModel.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index ce0486c4..f4eee499 100644 --- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -97,7 +97,7 @@ public class StatusBarViewModel : MyReactiveObject _config = AppManager.Instance.Config; SelectedRouting = new(); SelectedServer = new(); - RunningServerToolTipText = "-"; + RunningServerToolTipText = GetRunningServerToolTipText("-"); BlSystemProxyPacVisible = Utils.IsWindows(); BlIsNonWindows = Utils.IsNonWindows(); @@ -293,16 +293,21 @@ public class StatusBarViewModel : MyReactiveObject var running = await ConfigHandler.GetDefaultServer(_config); if (running != null) { - RunningServerDisplay = - RunningServerToolTipText = running.GetSummary(); + RunningServerDisplay = running.GetSummary(); + RunningServerToolTipText = GetRunningServerToolTipText(RunningServerDisplay); } else { - RunningServerDisplay = - RunningServerToolTipText = ResUI.CheckServerSettings; + RunningServerDisplay = ResUI.CheckServerSettings; + RunningServerToolTipText = GetRunningServerToolTipText(RunningServerDisplay); } } + private string GetRunningServerToolTipText(string serverInfo) + { + return Utils.IsLinux() ? Global.AppName : serverInfo; + } + private async Task RefreshServersMenu() { var lstModel = await AppManager.Instance.ProfileModels(_config.SubIndexId, "");