Repository: microsoft/PowerToys
File: src/modules/Workspaces/WorkspacesSnapshotTool/SnapshotUtils.cpp (C++)

Code before:
                    GetWindowThreadProcessId(otherWindow, &otherPid);

                    // searching for the window with the same title but different PID
                    if (pid != otherPid && title == WindowUtils::GetWindowTitle(otherWindow))
                    {
                        processPath = get_process_path(otherPid);
                        break;
                    }
                }
            }

            auto data = Utils::Apps::GetApp(processPath, pid, installedApps);
            if (!data.has_value() || data->name.empty())
            {
                Logger::info(L"Installed app not found:{},{}", reinterpret_cast<void*>(window), processPath);
                continue;
            }

            Logger::info(L"Found app for window:{},{}", reinterpret_cast<void*>(window), processPath);

            auto appData = data.value();

            bool isEdge = appData.IsEdge();
            bool isChrome = appData.IsChrome();
            if (isEdge || isChrome)
            {
                auto windowAumid = pwaHelper.GetAUMIDFromWindow(window);
                std::optional<std::wstring> pwaAppId{};

                if (isEdge)
                {
                    pwaAppId = pwaHelper.GetEdgeAppId(windowAumid);
                }
                else if (isChrome)
                {
                    pwaAppId = pwaHelper.GetChromeAppId(windowAumid);
                }

                if (pwaAppId.has_value())
                {
                    auto pwaName = pwaHelper.SearchPwaName(pwaAppId.value(), windowAumid);
                    Logger::info(L"Found {} PWA app with name {}, appId: {}", (isEdge ? L"Edge" : (isChrome ? L"Chrome" : L"unknown")), pwaName, pwaAppId.value());

                    appData.pwaAppId = pwaAppId.value();
                    appData.name = pwaName + L" (" + appData.name + L")";
                }
            }

            bool isMinimized = WindowUtils::IsMinimized(window);
            unsigned int monitorNumber = getMonitorNumberFromWindowHandle(window);


Review comment (bug):
Please also consider to keep which log info here, and make another one as debug?
including the logging at line 74 one.

Code after:
                    GetWindowThreadProcessId(otherWindow, &otherPid);

                    // searching for the window with the same title but different PID
                    if (pid != otherPid && title == WindowUtils::GetWindowTitle(otherWindow))
                    {
                        processPath = get_process_path(otherPid);
                        break;
                    }
                }
            }

            auto data = Utils::Apps::GetApp(processPath, pid, installedApps);
            if (!data.has_value() || data->name.empty())
            {
                Logger::info(L"Installed app not found:{},{}", reinterpret_cast<void*>(window), processPath);
                continue;
            }

            if (!data->IsSteamGame() && !WindowUtils::HasThickFrame(window))
            {
                // Only care about steam games if it has no thick frame to remain consistent with
                // the behavior as before.
                continue;
            }

            Logger::info(L"Found app for window:{},{}", reinterpret_cast<void*>(window), processPath);

            auto appData = data.value();

            bool isEdge = appData.IsEdge();
            bool isChrome = appData.IsChrome();
            if (isEdge || isChrome)
            {
                auto windowAumid = pwaHelper.GetAUMIDFromWindow(window);
                std::optional<std::wstring> pwaAppId{};

                if (isEdge)
                {
                    pwaAppId = pwaHelper.GetEdgeAppId(windowAumid);
                }
                else if (isChrome)
                {
                    pwaAppId = pwaHelper.GetChromeAppId(windowAumid);
                }

                if (pwaAppId.has_value())
                {
                    auto pwaName = pwaHelper.SearchPwaName(pwaAppId.value(), windowAumid);
                    Logger::info(L"Found {} PWA app with name {}, appId: {}", (isEdge ? L"Edge" : (isChrome ? L"Chrome" : L"unknown")), pwaName, pwaAppId.value());

                    appData.pwaAppId = pwaAppId.value();