mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 18:29:24 +08:00
Updated program execution to call action on background thread. (#2370)
This commit is contained in:
parent
368640b59b
commit
a6e8cbc50d
@ -160,17 +160,17 @@ namespace Wox.ViewModel
|
|||||||
if (!didExecuteContextButton)
|
if (!didExecuteContextButton)
|
||||||
{
|
{
|
||||||
var result = results.SelectedItem.Result;
|
var result = results.SelectedItem.Result;
|
||||||
if (result != null) // SelectedItem returns null if selection is empty.
|
if (result != null && result.Action != null) // SelectedItem returns null if selection is empty.
|
||||||
{
|
{
|
||||||
bool hideWindow = result.Action != null && result.Action(new ActionContext
|
MainWindowVisibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
result.Action(new ActionContext
|
||||||
{
|
{
|
||||||
SpecialKeyState = GlobalHotkey.Instance.CheckModifiers()
|
SpecialKeyState = GlobalHotkey.Instance.CheckModifiers()
|
||||||
});
|
});
|
||||||
|
});
|
||||||
if (hideWindow)
|
|
||||||
{
|
|
||||||
MainWindowVisibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SelectedIsFromQueryResults())
|
if (SelectedIsFromQueryResults())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user