Repository: microsoft/PowerToys
File: src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/ContextMenuHelper.cs (C#)

Code before:
        {
            if (!(result?.ContextData is Window windowData))
            {
                return new List<ContextMenuResult>(0);
            }

            var contextMenu = new List<ContextMenuResult>()
            {
                new ContextMenuResult
                {
                    AcceleratorKey = Key.F4,
                    AcceleratorModifiers = ModifierKeys.Control,
                    FontFamily = "Segoe MDL2 Assets",
                    Glyph = "\xE8BB",                       // E8B8 => Symbol: ChromeClose
                    Title = $"{Resources.wox_plugin_windowwalker_Close} (Ctrl+F4)",
                    Action = _ =>
                    {
                        if (!windowData.IsWindow)
                        {
                            Log.Debug($"Can not close the window '{windowData.Title}' ({windowData.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper));
                            return false;
                        }

                        return !WindowWalkerSettings.Instance.OpenAfterKillAndClose;
                    },
                },
            };

            // Hide menu if Explorer.exe is the shell process or the process name is ApplicationFrameHost.exe
            // In the first case we would crash the windows ui and in the second case we would kill the generic process for uwp apps.
            if (!windowData.Process.IsShellProcess && !(windowData.Process.IsUwpApp & windowData.Process.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture) == "applicationframehost.exe")
                && !(windowData.Process.IsFullAccessDenied & WindowWalkerSettings.Instance.HideKillProcessOnElevatedProcesses))
            {
                contextMenu.Add(new ContextMenuResult
                {
                    AcceleratorKey = Key.Delete,
                    AcceleratorModifiers = ModifierKeys.Control,
                    FontFamily = "Segoe MDL2 Assets",
                    Glyph = "\xE74D",                       // E74D => Symbol: Delete
                    Title = $"{Resources.wox_plugin_windowwalker_Kill} (Ctrl+Delete)",
                    Action = _ => KillProcessCommand(windowData),
                });
            }

            return contextMenu;
        }

        /// <summary>
        /// Method to initiate killing the process of a window
        /// </summary>
        /// <param name="window">Window data</param>

Review comment (suggestion):
Please keep the command, but set it's parameter to false or removing the workaround in the function of the `Window` class. Removing the entire method call here brakes the functionality of closing windows.

Code after:
        {
            if (!(result?.ContextData is Window windowData))
            {
                return new List<ContextMenuResult>(0);
            }

            var contextMenu = new List<ContextMenuResult>()
            {
                new ContextMenuResult
                {
                    AcceleratorKey = Key.F4,
                    AcceleratorModifiers = ModifierKeys.Control,
                    FontFamily = "Segoe MDL2 Assets",
                    Glyph = "\xE8BB",                       // E8B8 => Symbol: ChromeClose
                    Title = $"{Resources.wox_plugin_windowwalker_Close} (Ctrl+F4)",
                    Action = _ =>
                    {
                        if (!windowData.IsWindow)
                        {
                            Log.Debug($"Can not close the window '{windowData.Title}' ({windowData.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper));
                            return false;
                        }

                        windowData.CloseThisWindow();

                        return !WindowWalkerSettings.Instance.OpenAfterKillAndClose;
                    },
                },
            };

            // Hide menu if Explorer.exe is the shell process or the process name is ApplicationFrameHost.exe
            // In the first case we would crash the windows ui and in the second case we would kill the generic process for uwp apps.
            if (!windowData.Process.IsShellProcess && !(windowData.Process.IsUwpApp & windowData.Process.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture) == "applicationframehost.exe")
                && !(windowData.Process.IsFullAccessDenied & WindowWalkerSettings.Instance.HideKillProcessOnElevatedProcesses))
            {
                contextMenu.Add(new ContextMenuResult
                {
                    AcceleratorKey = Key.Delete,
                    AcceleratorModifiers = ModifierKeys.Control,
                    FontFamily = "Segoe MDL2 Assets",
                    Glyph = "\xE74D",                       // E74D => Symbol: Delete
                    Title = $"{Resources.wox_plugin_windowwalker_Kill} (Ctrl+Delete)",
                    Action = _ => KillProcessCommand(windowData),
                });
            }

            return contextMenu;
        }

        /// <summary>
        /// Method to initiate killing the process of a window