mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[PTRun][WindowWalker]Don't hang when closing an unresponsive window (#33167)
* add(windowWalkerComponents): added a "Responding" variable signifying if a process is responding or not * add(win32NativeMethod): added "SendMessageTimeout" method in the common Win32 namespace * refactor(windowWalkerWindow): added an implementation of the helper function for closing the window using the newly defined method refactor(windowWalkerWindow): added a thread to run, whenever "CloseThisWindow" is called * refactor(resultHelper): used localizable strings for printing the responding text add(resources): added "Not Responding" localizable text to the resources file * refactor(resultHelper): refactored the message in case of a "Not Responding" task * refactor(resultHelper): modified the formatting of the subtitle * refactor(window): refactored the helper function and removed the unnecessary variable * refactor(windowProcess): changed the variable name from "Responding" to "IsResponding" * add: added try-catch to isResponding getter
This commit is contained in:
@@ -92,6 +92,11 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
subtitleText += $" ({window.Process.ProcessID})";
|
||||
}
|
||||
|
||||
if (!window.Process.IsResponding)
|
||||
{
|
||||
subtitleText += $" [{Resources.wox_plugin_windowwalker_NotResponding}]";
|
||||
}
|
||||
|
||||
if (WindowWalkerSettings.Instance.SubtitleShowDesktopName && Main.VirtualDesktopHelperInstance.GetDesktopCount() > 1)
|
||||
{
|
||||
subtitleText += $" - {Resources.wox_plugin_windowwalker_Desktop}: {window.Desktop.Name}";
|
||||
@@ -148,7 +153,8 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
$"Desktop number: {window.Desktop.Number}\n" +
|
||||
$"Desktop is visible: {window.Desktop.IsVisible}\n" +
|
||||
$"Desktop position: {window.Desktop.Position}\n" +
|
||||
$"Is AllDesktops view: {window.Desktop.IsAllDesktopsView}";
|
||||
$"Is AllDesktops view: {window.Desktop.IsAllDesktopsView}\n" +
|
||||
$"Responding: {window.Process.IsResponding}";
|
||||
|
||||
return new ToolTipData(window.Title, text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user