Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 增加startupNotify名单,强制显示加载状态 #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions appinfo/desktopappinfo/desktopappinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ package desktopappinfo

import (
"bytes"
"encoding/json"
"errors"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -612,6 +614,37 @@ func startCommand(ai *DesktopAppInfo, cmdline string, files []string, launchCont

var snId string
startupNotify := ai.GetStartupNotify()
// 名单中的应用强制startupNotify,
forceStartupNotifyList := []string{
"com.alibabainc.dingtalk.desktop",
"com.qq.im.deepin.desktop",
"com.qq.weixin.deepin.desktop",
"com.qq.weixin.work.deepin.desktop",
"wemeetapp.desktop",
"wps-office-prometheus.desktop",
"cn.codemao.kitten3.desktop",
"cn.codemao.wood.desktop",
"cn.scratch.scratch.desktop",
"com.51dzt.deepin.desktop",
"com.macromediaflash8.deepin.desktop",
"com.meitu.mtxx.deepin.desktop",
"com.mspaint.deepin.desktop",
"com.qq.tenvideo.desktop",
"com.youku.deepin.desktop",
"com.youkuido.deepin.desktop",
"gimp.desktop",
"mu.codewith.mu-editor.desktop",
}
const startupNotifyListPath = "/var/lib/apps/startupNotifyList.json"
c, err := ioutil.ReadFile(startupNotifyListPath)
if err == nil {
_ = json.Unmarshal(c, &forceStartupNotifyList)
}
for _, d := range forceStartupNotifyList {
if strings.Contains(ai.GetFileName(), d) {
startupNotify = true
}
}
if startupNotify && launchContext != nil &&
launchContext.GetTimestamp() != 0 {
snId, _ = launchContext.GetStartupNotifyId(ai, files)
Expand Down