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