From d1fe32c13e21b72c71dda78b1f912ffe1b5907ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=9C=8B=E7=A8=8B?= Date: Mon, 5 Dec 2022 14:54:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BC=80=E6=9C=BA?= =?UTF-8?q?=E5=90=8E=E8=99=9A=E6=8B=9F=E9=94=AE=E7=9B=98=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 虚拟键盘仅在GNOME的桌面环境中自启动,desktop文件中已经给出相关配置,AM未进行判断 Log: 修复开机后虚拟键盘自动启动 Influence: 虚拟键盘自动开机启动 Bug: https://pms.uniontech.com/bug-view-175031.html Change-Id: I7c66535f819655ffb1c9609cb23a6dc3a7e6f415 --- src/modules/startmanager/startmanager.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/modules/startmanager/startmanager.cpp b/src/modules/startmanager/startmanager.cpp index dd920e1..4872147 100644 --- a/src/modules/startmanager/startmanager.cpp +++ b/src/modules/startmanager/startmanager.cpp @@ -533,7 +533,20 @@ QStringList StartManager::getAutostartList() if (autostartList.contains(entry.absoluteFilePath())) continue; - autostartList.push_back(entry.absoluteFilePath()); + // 需要检查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()); + }; + + if (isNeedAutoStart(entry.absoluteFilePath().toStdString())) + autostartList.push_back(entry.absoluteFilePath()); } }