mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Remove unnecessary thread switch
This commit is contained in:
parent
b283977281
commit
2dfcee6b25
2 changed files with 4 additions and 17 deletions
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Wox.CommandArgs;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Helper;
|
||||
using Application = System.Windows.Application;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
|
|
@ -35,6 +36,8 @@ namespace Wox
|
|||
AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;
|
||||
|
||||
Window = new MainWindow();
|
||||
PluginManager.Init(Window);
|
||||
ImageLoader.ImageLoader.PreloadImages();
|
||||
CommandArgsFactory.Execute(e.Args.ToList());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -207,18 +207,7 @@ namespace Wox
|
|||
InitialTray();
|
||||
|
||||
Closing += MainWindow_Closing;
|
||||
//since MainWIndow implement IPublicAPI, so we need to finish ctor MainWindow object before
|
||||
//PublicAPI invoke in plugin init methods. E.g FolderPlugin
|
||||
ThreadPool.QueueUserWorkItem(o =>
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
PluginManager.Init(this);
|
||||
});
|
||||
ThreadPool.QueueUserWorkItem(o =>
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
PreLoadImages();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void pnlResult_ItemDropEvent(Result result, IDataObject dropDataObject, DragEventArgs args)
|
||||
|
|
@ -245,11 +234,6 @@ namespace Wox
|
|||
return true;
|
||||
}
|
||||
|
||||
private void PreLoadImages()
|
||||
{
|
||||
ImageLoader.ImageLoader.PreloadImages();
|
||||
}
|
||||
|
||||
void pnlResult_RightMouseClickEvent(Result result)
|
||||
{
|
||||
ShowContextMenu(result);
|
||||
|
|
|
|||
Loading…
Reference in a new issue