refact: return early in identifyWindowByPidEnv
-
This commit is contained in:
parent
010d0c40f6
commit
4e43ef0cdb
@ -223,7 +223,11 @@ AppInfo *WindowIdentify::identifyWindowByPidEnv(Dock *_dock, WindowInfoX *winInf
|
||||
int pid = winInfo->getPid();
|
||||
auto process = winInfo->getProcess();
|
||||
qInfo() << "identifyWindowByPidEnv: pid=" << pid << " WindowId=" << winInfo->getXid();
|
||||
if (pid != 0 && process) {
|
||||
|
||||
if (pid == 0 || !process) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
QString launchedDesktopFile = process->getEnv("GIO_LAUNCHED_DESKTOP_FILE").c_str();
|
||||
QString launchedDesktopFilePidStr = process->getEnv("GIO_LAUNCHED_DESKTOP_FILE_PID").c_str();
|
||||
int launchedDesktopFilePid = launchedDesktopFilePidStr.toInt();
|
||||
@ -255,7 +259,6 @@ AppInfo *WindowIdentify::identifyWindowByPidEnv(Dock *_dock, WindowInfoX *winInf
|
||||
ret = new AppInfo(launchedDesktopFile);
|
||||
innerId = ret->getInnerId();
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user