mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
Added cold start fix (#2385)
This commit is contained in:
committed by
GitHub
parent
a6e8cbc50d
commit
6290630787
@@ -210,10 +210,16 @@ namespace PowerLauncher
|
||||
_resultList = (UI.ResultList)host.Child;
|
||||
_resultList.DataContext = _viewModel;
|
||||
_resultList.Tapped += SuggestionsList_Tapped;
|
||||
_resultList.SuggestionsList.Loaded += SuggestionsList_Loaded;
|
||||
_resultList.SuggestionsList.SelectionChanged += SuggestionsList_SelectionChanged;
|
||||
_resultList.SuggestionsList.ContainerContentChanging += SuggestionList_UpdateListSize;
|
||||
}
|
||||
|
||||
private void SuggestionsList_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
_viewModel.ColdStartFix();
|
||||
}
|
||||
|
||||
private bool IsKeyDown(VirtualKey key)
|
||||
{
|
||||
var keyState = CoreWindow.GetForCurrentThread().GetKeyState(key);
|
||||
|
||||
@@ -613,6 +613,32 @@ namespace Wox.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, "0");
|
||||
Results.Clear();
|
||||
MainWindowVisibility = System.Windows.Visibility.Collapsed;
|
||||
|
||||
// Fix Cold start for plugins
|
||||
string s = "m";
|
||||
var query = QueryBuilder.Build(s.Trim(), PluginManager.NonGlobalPlugins);
|
||||
var plugins = PluginManager.ValidPluginsForQuery(query);
|
||||
foreach (PluginPair plugin in plugins)
|
||||
{
|
||||
if (!plugin.Metadata.Disabled && plugin.Metadata.Name != "Window Walker")
|
||||
{
|
||||
var _ = PluginManager.QueryForPlugin(plugin, query);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user