Skip to content

Commit

Permalink
[PTRun][WindowWalker] Fixes and small improvements (#16959)
Browse files Browse the repository at this point in the history
* fixes and changes

* fix spelling

* add os version check

* Improve speed of virtual desktop helper

* speed improvement two
  • Loading branch information
htcfreek committed Mar 14, 2022
1 parent 50169f9 commit bf3e427
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 62 deletions.
Expand Up @@ -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;

Expand Down Expand Up @@ -89,7 +88,7 @@ internal bool WindowEnumerationCallBack(IntPtr hwnd, IntPtr lParam)

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.)
Expand Down
Expand Up @@ -126,7 +126,8 @@ private static ToolTipData GetToolTip(Window window, bool debugToolTip)
$"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" +
Expand Down
Expand Up @@ -307,7 +307,7 @@ internal WindowCloakState GetWindowCloakState()
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:
Expand Down
Expand Up @@ -4,7 +4,6 @@

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Windows.Controls;
using ManagedCommon;
using Microsoft.Plugin.WindowWalker.Components;
Expand All @@ -24,8 +23,6 @@ public class Main : IPlugin, IPluginI18n, ISettingProvider, IContextMenu

public string Name => Properties.Resources.wox_plugin_windowwalker_plugin_name;

private readonly string _assemblyName = Assembly.GetExecutingAssembly().GetName().Name;

public string Description => Properties.Resources.wox_plugin_windowwalker_plugin_description;

internal static readonly VirtualDesktopHelper VirtualDesktopHelperInstance = new VirtualDesktopHelper();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -140,10 +140,10 @@
<value>Show only results from visible desktop</value>
</data>
<data name="wox_plugin_windowwalker_SettingSubtitleDesktopName" xml:space="preserve">
<value>Show desktop name in subtitle (If two or more desktops exist)</value>
<value>Show desktop name in the subtitle (If two or more desktops exist)</value>
</data>
<data name="wox_plugin_windowwalker_SettingSubtitlePid" xml:space="preserve">
<value>Show process id in subtitle</value>
<value>Show process id in the subtitle</value>
</data>
<data name="wox_plugin_windowwalker_SettingOpenAfterKillAndClose" xml:space="preserve">
<value>Stay open after closing windows and killing processes (Not working with kill process confirmation)</value>
Expand Down
Expand Up @@ -73,7 +73,7 @@ public static VDesktop Empty
Id = Guid.Empty,
Name = string.Empty,
Number = 0,
IsVisible = false,
IsVisible = true, // Setting this always to true to simulate a visible desktop
IsAllDesktopsView = false,
Position = VirtualDesktopPosition.NotApplicable,
};
Expand Down

0 comments on commit bf3e427

Please sign in to comment.