mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-11 05:52:19 +02:00
Fix a crash in Win8
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<TextBox Style="{DynamicResource QueryBoxStyle}" PreviewDragOver="TbQuery_OnPreviewDragOver" AllowDrop="True" Grid.Row="0" x:Name="tbQuery" PreviewKeyDown="TbQuery_OnPreviewKeyDown" TextChanged="TextBoxBase_OnTextChanged" />
|
<TextBox Style="{DynamicResource QueryBoxStyle}" PreviewDragOver="TbQuery_OnPreviewDragOver" AllowDrop="True" Grid.Row="0" x:Name="tbQuery" PreviewKeyDown="TbQuery_OnPreviewKeyDown" TextChanged="TextBoxBase_OnTextChanged" />
|
||||||
<Line Style="{DynamicResource PendingLineStyle}" x:Name="progressBar" Y1="0" Y2="0" X2="100" Grid.Row="1" Height="2" StrokeThickness="1"></Line>
|
<Line Style="{DynamicResource PendingLineStyle}" x:Name="progressBar" Y1="0" Y2="0" X2="100" Grid.Row="1" Height="2" StrokeThickness="1"></Line>
|
||||||
<wox:ResultPanel x:Name="resultCtrl" Grid.Row="2"/>
|
<wox:ResultPanel x:Name="resultCtrl" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -325,14 +325,12 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
}, TimeSpan.FromMilliseconds(ShouldNotDelayQuery ? 0 : 150));
|
}, TimeSpan.FromMilliseconds(ShouldNotDelayQuery ? 0 : 150));
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ShouldNotDelayQuery
|
private bool ShouldNotDelayQuery
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
|
||||||
return (bool)Dispatcher.Invoke(new Func<bool>(() =>
|
|
||||||
{
|
{
|
||||||
return IsCMDMode || IsWebSearchMode;
|
return IsCMDMode || IsWebSearchMode;
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,7 +352,6 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Border_OnMouseDown(object sender, MouseButtonEventArgs e)
|
private void Border_OnMouseDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.ChangedButton == MouseButton.Left) DragMove();
|
if (e.ChangedButton == MouseButton.Left) DragMove();
|
||||||
@@ -578,12 +575,10 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
waitShowResultList.AddRange(list);
|
waitShowResultList.AddRange(list);
|
||||||
}
|
}
|
||||||
Dispatcher.DelayInvoke("ShowResult", k => resultCtrl.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
List<Result> l = waitShowResultList.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == lastQuery).ToList();
|
List<Result> l = waitShowResultList.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == lastQuery).ToList();
|
||||||
waitShowResultList.Clear();
|
waitShowResultList.Clear();
|
||||||
resultCtrl.AddResults(l);
|
|
||||||
})), TimeSpan.FromMilliseconds(ShouldNotDelayQuery ? 0 : 50));
|
Dispatcher.Invoke(new Action(() => resultCtrl.AddResults(l)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user