fix: 修复开机后虚拟键盘自动启动的问题

虚拟键盘仅在GNOME的桌面环境中自启动,desktop文件中已经给出相关配置,AM未进行判断

Log: 修复开机后虚拟键盘自动启动
Influence: 虚拟键盘自动开机启动
Bug: https://pms.uniontech.com/bug-view-175031.html
Change-Id: I7c66535f819655ffb1c9609cb23a6dc3a7e6f415
This commit is contained in:
范朋程 2022-12-05 14:54:21 +08:00 committed by fanpengcheng
parent 6354629a82
commit d1fe32c13e

View File

@ -533,6 +533,19 @@ QStringList StartManager::getAutostartList()
if (autostartList.contains(entry.absoluteFilePath())) if (autostartList.contains(entry.absoluteFilePath()))
continue; continue;
// 需要检查desktop文件中的Hidden,OnlyShowIn和NotShowIn字段,再决定是否需要自启动
auto isNeedAutoStart = [ ](const std::string &_fileName){
DesktopInfo info(_fileName);
if (!info.isValidDesktop())
return false;
if (info.getIsHidden())
return false;
return info.getShowIn(std::vector<std::string>());
};
if (isNeedAutoStart(entry.absoluteFilePath().toStdString()))
autostartList.push_back(entry.absoluteFilePath()); autostartList.push_back(entry.absoluteFilePath());
} }
} }