[PTRun]Remove cold start and fix initialization error (#29770)
This commit is contained in:
Родитель
479c95b32b
Коммит
967b888ba1
|
@ -9,27 +9,20 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using Common.UI;
|
using Common.UI;
|
||||||
|
|
||||||
using interop;
|
using interop;
|
||||||
|
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
|
|
||||||
using Microsoft.PowerLauncher.Telemetry;
|
using Microsoft.PowerLauncher.Telemetry;
|
||||||
using Microsoft.PowerToys.Telemetry;
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
|
||||||
using PowerLauncher.Helper;
|
using PowerLauncher.Helper;
|
||||||
using PowerLauncher.Plugin;
|
using PowerLauncher.Plugin;
|
||||||
using PowerLauncher.ViewModel;
|
using PowerLauncher.ViewModel;
|
||||||
|
|
||||||
using Wox;
|
using Wox;
|
||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
using Wox.Infrastructure.Image;
|
using Wox.Infrastructure.Image;
|
||||||
using Wox.Infrastructure.UserSettings;
|
using Wox.Infrastructure.UserSettings;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
using Wox.Plugin.Logger;
|
using Wox.Plugin.Logger;
|
||||||
|
|
||||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||||
|
|
||||||
namespace PowerLauncher
|
namespace PowerLauncher
|
||||||
|
@ -155,8 +148,6 @@ namespace PowerLauncher
|
||||||
|
|
||||||
_settingsReader.ReadSettingsOnChange();
|
_settingsReader.ReadSettingsOnChange();
|
||||||
|
|
||||||
_mainVM.MainWindowVisibility = Visibility.Visible;
|
|
||||||
_mainVM.ColdStartFix();
|
|
||||||
_themeManager.ThemeChanged += OnThemeChanged;
|
_themeManager.ThemeChanged += OnThemeChanged;
|
||||||
textToLog.AppendLine("End PowerToys Run startup ---------------------------------------------------- ");
|
textToLog.AppendLine("End PowerToys Run startup ---------------------------------------------------- ");
|
||||||
|
|
||||||
|
@ -164,11 +155,6 @@ namespace PowerLauncher
|
||||||
|
|
||||||
Log.Info(textToLog.ToString(), GetType());
|
Log.Info(textToLog.ToString(), GetType());
|
||||||
PowerToysTelemetry.Log.WriteEvent(new LauncherBootEvent() { BootTimeMs = bootTime.ElapsedMilliseconds });
|
PowerToysTelemetry.Log.WriteEvent(new LauncherBootEvent() { BootTimeMs = bootTime.ElapsedMilliseconds });
|
||||||
|
|
||||||
// [Conditional("RELEASE")]
|
|
||||||
// check update every 5 hours
|
|
||||||
|
|
||||||
// check updates on startup
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ using System.IO.Abstractions;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
using global::PowerToys.GPOWrapper;
|
using global::PowerToys.GPOWrapper;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using PowerLauncher.Properties;
|
using PowerLauncher.Properties;
|
||||||
|
@ -180,7 +181,7 @@ namespace PowerLauncher.Plugin
|
||||||
{
|
{
|
||||||
var failed = string.Join(",", failedPlugins.Select(x => x.Metadata.Name));
|
var failed = string.Join(",", failedPlugins.Select(x => x.Metadata.Name));
|
||||||
var description = string.Format(CultureInfo.CurrentCulture, Resources.FailedToInitializePluginsDescription, failed);
|
var description = string.Format(CultureInfo.CurrentCulture, Resources.FailedToInitializePluginsDescription, failed);
|
||||||
API.ShowMsg(Resources.FailedToInitializePluginsTitle, description, string.Empty, false);
|
Application.Current.Dispatcher.InvokeAsync(() => API.ShowMsg(Resources.FailedToInitializePluginsTitle, description, string.Empty, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1028,34 +1028,6 @@ namespace PowerLauncher.ViewModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ColdStartFix()
|
|
||||||
{
|
|
||||||
// Fix Cold start for List view xaml island
|
|
||||||
List<Result> list = new List<Result>();
|
|
||||||
Result r = new Result
|
|
||||||
{
|
|
||||||
Title = "hello",
|
|
||||||
};
|
|
||||||
list.Add(r);
|
|
||||||
Results.AddResults(list, _updateToken);
|
|
||||||
Results.Clear();
|
|
||||||
|
|
||||||
// Fix Cold start for plugins, "m" is just a random string needed to query results
|
|
||||||
var pluginQueryPairs = QueryBuilder.Build("m");
|
|
||||||
|
|
||||||
// To execute a query corresponding to each plugin
|
|
||||||
foreach (KeyValuePair<PluginPair, Query> pluginQueryItem in pluginQueryPairs)
|
|
||||||
{
|
|
||||||
var plugin = pluginQueryItem.Key;
|
|
||||||
var query = pluginQueryItem.Value;
|
|
||||||
|
|
||||||
if (!plugin.Metadata.Disabled && plugin.Metadata.Name != "Window Walker")
|
|
||||||
{
|
|
||||||
_ = PluginManager.QueryForPlugin(plugin, query);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void HandleContextMenu(Key acceleratorKey, ModifierKeys acceleratorModifiers)
|
public void HandleContextMenu(Key acceleratorKey, ModifierKeys acceleratorModifiers)
|
||||||
{
|
{
|
||||||
var results = SelectedResults;
|
var results = SelectedResults;
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.Loader;
|
using System.Runtime.Loader;
|
||||||
|
using System.Windows;
|
||||||
using Microsoft.PowerToys.Settings.UI.Library;
|
using Microsoft.PowerToys.Settings.UI.Library;
|
||||||
using Wox.Plugin.Logger;
|
using Wox.Plugin.Logger;
|
||||||
using Wox.Plugin.Properties;
|
using Wox.Plugin.Properties;
|
||||||
|
@ -74,7 +74,7 @@ namespace Wox.Plugin
|
||||||
if (!IsPluginInitialized)
|
if (!IsPluginInitialized)
|
||||||
{
|
{
|
||||||
string description = $"{Resources.FailedToLoadPluginDescription} {Metadata.Name}\n\n{Resources.FailedToLoadPluginDescriptionPartTwo}";
|
string description = $"{Resources.FailedToLoadPluginDescription} {Metadata.Name}\n\n{Resources.FailedToLoadPluginDescriptionPartTwo}";
|
||||||
api.ShowMsg(Resources.FailedToLoadPluginTitle, description, string.Empty, false);
|
Application.Current.Dispatcher.InvokeAsync(() => api.ShowMsg(Resources.FailedToLoadPluginTitle, description, string.Empty, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Загрузка…
Ссылка в новой задаче