mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 13:35:31 +02:00
Updated program execution to call action on background thread. (#2370)
This commit is contained in:
committed by
GitHub
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;
|
||||||
{
|
|
||||||
SpecialKeyState = GlobalHotkey.Instance.CheckModifiers()
|
|
||||||
});
|
|
||||||
|
|
||||||
if (hideWindow)
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
MainWindowVisibility = Visibility.Collapsed;
|
result.Action(new ActionContext
|
||||||
}
|
{
|
||||||
|
SpecialKeyState = GlobalHotkey.Instance.CheckModifiers()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if (SelectedIsFromQueryResults())
|
if (SelectedIsFromQueryResults())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user