Skip to content

Commit

Permalink
Merge pull request #37 from merken/master
Browse files Browse the repository at this point in the history
Implemented SearchWindowsAcrossAllVDesktop
  • Loading branch information
taooceros authored Oct 15, 2022
2 parents dc13d12 + d4d2dbf commit b119192
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions Components/OpenWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public List<Window> Windows
/// </summary>
public static OpenWindows Instance => instance ??= new OpenWindows();

public bool SearchWindowsAcrossAllVDesktop = false;

/// <summary>
/// Initializes a new instance of the <see cref="OpenWindows"/> class.
/// Private constructor to make sure there is never
Expand Down Expand Up @@ -74,14 +76,14 @@ public bool WindowEnumerationCallBack(IntPtr hwnd, IntPtr lParam)

if (newWindow.IsWindow && newWindow.Visible && newWindow.IsOwner
&& (!newWindow.IsToolWindow || newWindow.IsAppWindow) && !newWindow.TaskListDeleted
&& (newWindow.Desktop.IsVisible || Main.VirtualDesktopHelperInstance.GetDesktopCount() < 2)
&& (SearchWindowsAcrossAllVDesktop || (newWindow.Desktop.IsVisible || Main.VirtualDesktopHelperInstance.GetDesktopCount() < 2))
&& newWindow.ClassName != "Windows.UI.Core.CoreWindow"
&& newWindow.Process.Name != flowLauncherExe
&& (!newWindow.IsCloaked ||
newWindow.GetWindowCloakState() ==
Window.WindowCloakState.OtherDesktop)
// To hide (not add) preloaded uwp app windows that are invisible to the user and other cloaked windows,
// we check the cloak state.
Window.WindowCloakState.OtherDesktop)
// To hide (not add) preloaded uwp app windows that are invisible to the user and other cloaked windows,
// we check the cloak state.
)
{
windows.Add(newWindow);
Expand Down
3 changes: 2 additions & 1 deletion Components/SearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ public static string SearchText
/// <summary>
/// Event handler for when the search text has been updated
/// </summary>
public static List<SearchResult> GetResult(string searchText)
public static List<SearchResult> GetResult(string searchText, bool searchWindowsAcrossAllVDesktop)
{
SearchText = searchText;
OpenWindows.Instance.SearchWindowsAcrossAllVDesktop = searchWindowsAcrossAllVDesktop;
return OpenWindowsWithModel();
}

Expand Down
2 changes: 1 addition & 1 deletion Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public List<Result> Query(Query query)
VirtualDesktopHelperInstance.UpdateDesktopList();
OpenWindows.Instance.UpdateOpenWindowsList();

var searchResults = SearchController.GetResult(query.Search);
var searchResults = SearchController.GetResult(query.Search, Settings.SearchWindowsAcrossAllVDesktop);

var results = searchResults.Where(x => !string.IsNullOrEmpty(x.Result.Title))
.Select(x => new Result()
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name":"Window Walker",
"Description":"Alt-Tab alternative enabling searching through your windows.",
"Author":"betadele",
"Version":"2.2.1",
"Version":"2.2.2",
"Language":"csharp",
"Website":"https://www.windowwalker.com/",
"ExecuteFileName":"Flow.Plugin.WindowWalker.dll",
Expand Down

0 comments on commit b119192

Please sign in to comment.