From 1fd19ce97d22cfbc5c5810aed83a74c59f2c2cc1 Mon Sep 17 00:00:00 2001 From: black-desk Date: Thu, 11 May 2023 11:52:01 +0800 Subject: [PATCH] fix: early return in WindowIdentify::identifyWindowByPidEnv If we cannot get desktop file from env, we should just failed. --- src/modules/dock/windowidentify.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/dock/windowidentify.cpp b/src/modules/dock/windowidentify.cpp index 9036448..91f6297 100644 --- a/src/modules/dock/windowidentify.cpp +++ b/src/modules/dock/windowidentify.cpp @@ -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();