[PTRun][WindowWalker] Fixes and small improvements (#16959)

* fixes and changes

* fix spelling

* add os version check

* Improve speed of virtual desktop helper

* speed improvement two
This commit is contained in:
Heiko
2022-03-14 16:40:27 +01:00
committed by GitHub
parent 50169f9271
commit bf3e427017
8 changed files with 109 additions and 66 deletions

View File

@@ -5,7 +5,6 @@
// Code forked from Betsegaw Tadele's https://github.com/betsegaw/windowwalker/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using Wox.Plugin.Common.Win32;
@@ -89,7 +88,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
if (newWindow.IsWindow && newWindow.Visible && newWindow.IsOwner &&
(!newWindow.IsToolWindow || newWindow.IsAppWindow) && !newWindow.TaskListDeleted &&
(newWindow.Desktop.IsVisible || !WindowWalkerSettings.Instance.ResultsFromVisibleDesktopOnly) &&
(newWindow.Desktop.IsVisible || !WindowWalkerSettings.Instance.ResultsFromVisibleDesktopOnly || Main.VirtualDesktopHelperInstance.GetDesktopCount() < 2) &&
newWindow.ClassName != "Windows.UI.Core.CoreWindow" && newWindow.Process.Name != _powerLauncherExe)
{
// To hide (not add) preloaded uwp app windows that are invisible to the user and other cloaked windows, we check the cloak state. (Issue #13637.)

View File

@@ -126,7 +126,8 @@ namespace Microsoft.Plugin.WindowWalker.Components
$"Is ShellProcess: {window.Process.IsShellProcess}\n" +
$"Is window cloaked: {window.IsCloaked}\n" +
$"Window cloak state: {window.GetWindowCloakState()}\n" +
$"Desktop name: {window.Desktop.Name}" +
$"Desktop id: {window.Desktop.Id}\n" +
$"Desktop name: {window.Desktop.Name}\n" +
$"Desktop number: {window.Desktop.Number}\n" +
$"Desktop is visible: {window.Desktop.IsVisible}\n" +
$"Desktop position: {window.Desktop.Position}\n" +

View File

@@ -307,7 +307,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
case (int)DwmWindowCloakStates.CloakedApp:
return WindowCloakState.App;
case (int)DwmWindowCloakStates.CloakedShell:
return Main.VirtualDesktopHelperInstance.IsWindowCloakedByVirtualDesktopManager(hwnd) ? WindowCloakState.OtherDesktop : WindowCloakState.Shell;
return Main.VirtualDesktopHelperInstance.IsWindowCloakedByVirtualDesktopManager(hwnd, Desktop.Id) ? WindowCloakState.OtherDesktop : WindowCloakState.Shell;
case (int)DwmWindowCloakStates.CloakedInherited:
return WindowCloakState.Inherited;
default: