mirror of
https://github.com/2dust/v2rayN.git
synced 2026-07-26 09:52:05 +03:00
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:
@@ -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, "");
|
||||
|
||||
Reference in New Issue
Block a user