From 543cd5af802c17e9728f3123d72eb13ce797df86 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sun, 8 Nov 2015 03:06:34 +0000 Subject: [PATCH] Fix progress bar Bug introduced in 9962ddf2ed80a00036ebdb2965429675c4355472 --- Wox/MainWindow.xaml.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 97cb97d162..5a289131ed 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -443,25 +443,19 @@ namespace Wox private void TbQuery_OnTextChanged(object sender, TextChangedEventArgs e) { - if (_ignoreTextChange) { _ignoreTextChange = false; return; } - string query = tbQuery.Text.Trim(); + toolTip.IsOpen = false; if (IsInContextMenuMode) { QueryContextMenu(); return; } + + string query = tbQuery.Text.Trim(); if (!string.IsNullOrEmpty(query)) { Query(query); - Dispatcher.DelayInvoke("ShowProgressbar", () => - { - if (!string.IsNullOrEmpty(query) && query != _lastQuery.RawQuery && !_queryHasReturn) - { - StartProgress(); - } - }, TimeSpan.FromMilliseconds(150)); //reset query history index after user start new query ResetQueryHistoryIndex(); } @@ -478,6 +472,7 @@ namespace Wox } private void Query(string text) { + _queryHasReturn = false; var query = PluginManager.QueryInit(text); if (query != null) { @@ -503,6 +498,13 @@ namespace Wox } } _lastQuery = query; + Dispatcher.DelayInvoke("ShowProgressbar", () => + { + if (!string.IsNullOrEmpty(query.RawQuery) && query.RawQuery == _lastQuery.RawQuery && !_queryHasReturn) + { + StartProgress(); + } + }, TimeSpan.FromMilliseconds(150)); PluginManager.QueryForAllPlugins(query); } StopProgress();