Skip to content

Commit

Permalink
Fixed: Double results no longer returned
Browse files Browse the repository at this point in the history
When searching for text associated with a shortcut, a window is no
longer returned twice for matching with both the shortcut text and the
actual search text
  • Loading branch information
betsegaw committed Sep 7, 2014
1 parent e27c57e commit 22e7c54
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Window Walker/Window Walker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ private void TextChangedEvent(object sender, TextChangedEventArgs e)
public void SearchResultUpdateHandler(object sender, WindowWalker.Components.Window.WindowListUpdateEventArgs e)
{
this.Dispatcher.Invoke(() =>
{
{
resultsListBox.Items.Clear();
var windowsResult = WindowSearchController.Instance.SearchMatches.Where(x => x.ResultWindow.Hwnd != this.handleToMainWindow);
Expand All @@ -93,10 +92,21 @@ public void SearchResultUpdateHandler(object sender, WindowWalker.Components.Win
windowResultsByType.Add(windowsShortcutResults.ToList());
windowResultsByType.Add(windowsFuzzyResults.ToList());
Dictionary<IntPtr, bool> windowsAlreadyDisplayed = new Dictionary<IntPtr, bool>();
foreach (var windowsResultForType in windowResultsByType)
{
foreach (WindowSearchResult windowResult in windowsResultForType)
{
if (windowsAlreadyDisplayed.ContainsKey(windowResult.ResultWindow.Hwnd))
{
continue;
}
else
{
windowsAlreadyDisplayed[windowResult.ResultWindow.Hwnd] = true;
}
/// Each window is shown in a horizontal stack panel
/// that contains an image object on the left and
/// a textblock with the window title on the right
Expand Down

0 comments on commit 22e7c54

Please sign in to comment.