mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Fix select result item delay issue.
This commit is contained in:
@@ -309,11 +309,18 @@ namespace Wox
|
||||
Result result = resultCtrl.AcceptSelect();
|
||||
if (result != null)
|
||||
{
|
||||
CommonStorage.Instance.UserSelectedRecords.Add(result);
|
||||
if (!result.DontHideWoxAfterSelect)
|
||||
{
|
||||
HideWox();
|
||||
}
|
||||
if (result.Action != null)
|
||||
{
|
||||
result.Action(new ActionContext()
|
||||
{
|
||||
SpecialKeyState = new GloablHotkey().CheckModifiers()
|
||||
});
|
||||
CommonStorage.Instance.UserSelectedRecords.Add(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,16 +342,9 @@ namespace Wox
|
||||
}
|
||||
Dispatcher.DelayInvoke("ShowResult", k => resultCtrl.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
int t1 = Environment.TickCount;
|
||||
|
||||
List<Result> l =
|
||||
waitShowResultList.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == tbQuery.Text)
|
||||
.ToList();
|
||||
List<Result> l =waitShowResultList.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == tbQuery.Text).ToList();
|
||||
waitShowResultList.Clear();
|
||||
|
||||
resultCtrl.AddResults(l);
|
||||
|
||||
Debug.WriteLine("Total Time:" + (Environment.TickCount - t1) + " Count:" + l.Count);
|
||||
})), TimeSpan.FromMilliseconds(50));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,21 +96,7 @@ namespace Wox
|
||||
int index = lbResults.SelectedIndex;
|
||||
if (index < 0) return null;
|
||||
|
||||
var result = lbResults.Items[index] as Result;
|
||||
if (result != null)
|
||||
{
|
||||
if (result.Action != null)
|
||||
{
|
||||
result.Action(new ActionContext()
|
||||
{
|
||||
SpecialKeyState = new GloablHotkey().CheckModifiers()
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return null;
|
||||
return lbResults.Items[index] as Result;
|
||||
}
|
||||
|
||||
public ResultPanel()
|
||||
|
||||
Reference in New Issue
Block a user