fix: early return in WindowIdentify::identifyWindowByPidEnv

If we cannot get desktop file from env, we should just failed.
This commit is contained in:
black-desk 2023-05-11 11:52:01 +08:00 committed by deepin-bot[bot]
parent b9e5abf214
commit 1fd19ce97d

View File

@ -208,6 +208,10 @@ AppInfo *WindowIdentify::identifyWindowByPidEnv(Dock *_dock, WindowInfoX *winInf
int launchedDesktopFilePid = launchedDesktopFilePidStr.toInt();
qInfo() << "launchedDesktopFilePid=" << launchedDesktopFilePid << " launchedDesktopFile=" << launchedDesktopFile;
if (launchedDesktopFile.isEmpty()) {
return ret;
}
auto pidIsSh = [](int pid) -> bool {
Process parentProcess(pid);
auto parentCmdLine = parentProcess.getCmdLine();