!54 [sync] PR-53: upgrade to version 5.14.122
From: @openeuler-sync-bot Reviewed-by: @leeffo Signed-off-by: @leeffo
This commit is contained in:
commit
cdc3ad3d52
@ -1,317 +0,0 @@
|
||||
From 01c17723fa4f91c40ac946e9d02bd55be85c1f75 Mon Sep 17 00:00:00 2001
|
||||
From: yangxianzhao <yangxianzhao@uniontech.com>
|
||||
Date: Thu, 6 Apr 2023 10:06:18 +0800
|
||||
Subject: [PATCH] Fix-the-system-monitor-displaying-a-scene
|
||||
|
||||
---
|
||||
dock/dock_manager_entries.go | 3 +-
|
||||
dock/dock_manager_xevent.go | 13 ++++---
|
||||
dock/identify_window.go | 70 ++++++++++++++++++++++++------------
|
||||
3 files changed, 58 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/dock/dock_manager_entries.go b/dock/dock_manager_entries.go
|
||||
index ad758c8..bf4c1d5 100644
|
||||
--- a/dock/dock_manager_entries.go
|
||||
+++ b/dock/dock_manager_entries.go
|
||||
@@ -83,6 +83,7 @@ func (m *Manager) attachOrDetachWindow(winInfo *WindowInfo) {
|
||||
} else {
|
||||
|
||||
if winInfo.entryInnerId == "" {
|
||||
+ logger.Debugf("winInfo.entryInnerId is empty, call identifyWindow, win: %d", winInfo.window)
|
||||
winInfo.entryInnerId, winInfo.appInfo = m.identifyWindow(winInfo)
|
||||
m.markAppLaunched(winInfo.appInfo)
|
||||
} else {
|
||||
@@ -173,7 +174,7 @@ func (m *Manager) attachWindow(winInfo *WindowInfo) {
|
||||
func (m *Manager) detachWindow(winInfo *WindowInfo) {
|
||||
entry := m.Entries.getByWindowId(winInfo.window)
|
||||
if entry == nil {
|
||||
- logger.Warningf("entry of window '%x' is nil", winInfo.window)
|
||||
+ logger.Warningf("entry of window %d is nil", winInfo.window)
|
||||
return
|
||||
}
|
||||
needRemove := entry.detachWindow(winInfo)
|
||||
diff --git a/dock/dock_manager_xevent.go b/dock/dock_manager_xevent.go
|
||||
index 17468bf..c67a776 100644
|
||||
--- a/dock/dock_manager_xevent.go
|
||||
+++ b/dock/dock_manager_xevent.go
|
||||
@@ -21,6 +21,7 @@ package dock
|
||||
|
||||
import (
|
||||
"sort"
|
||||
+ "strings"
|
||||
"time"
|
||||
|
||||
x "github.com/linuxdeepin/go-x11-client"
|
||||
@@ -76,12 +77,13 @@ func (m *Manager) handleClientListChanged() {
|
||||
for _, win := range add {
|
||||
window0 := win
|
||||
addFunc := func() {
|
||||
- logger.Debugf("client list add: %x", window0)
|
||||
+ logger.Debugf("client list add: %d", window0)
|
||||
winInfo := m.registerWindow(window0)
|
||||
logger.Infof("%v", m.windowInfoMap)
|
||||
repeatCount := 0
|
||||
for {
|
||||
if repeatCount > 10 {
|
||||
+ logger.Debugf("give up identify window %d", window0)
|
||||
return
|
||||
}
|
||||
good := isGoodWindow(window0)
|
||||
@@ -90,7 +92,9 @@ func (m *Manager) handleClientListChanged() {
|
||||
}
|
||||
pid := getWmPid(window0)
|
||||
wmClass, _ := getWmClass(window0)
|
||||
- if pid != 0 || wmClass != nil {
|
||||
+ wmName := getWmName(window0)
|
||||
+ wmCmd, _ := getWmCommand(window0)
|
||||
+ if pid != 0 || wmClass != nil || wmName != "" || strings.Join(wmCmd, "") != "" {
|
||||
m.attachOrDetachWindow(winInfo)
|
||||
return
|
||||
}
|
||||
@@ -106,7 +110,7 @@ func (m *Manager) handleClientListChanged() {
|
||||
for _, win := range remove {
|
||||
window0 := win
|
||||
removeFunc := func() {
|
||||
- logger.Debugf("client list remove: %x", window0)
|
||||
+ logger.Debugf("client list remove: %d", window0)
|
||||
m.windowInfoMapMutex.RLock()
|
||||
logger.Infof("%v", m.windowInfoMap)
|
||||
winInfo := m.windowInfoMap[window0]
|
||||
@@ -115,7 +119,7 @@ func (m *Manager) handleClientListChanged() {
|
||||
m.detachWindow(winInfo)
|
||||
winInfo.entryInnerId = ""
|
||||
} else {
|
||||
- logger.Warningf("window info of '%x' is nil", window0)
|
||||
+ logger.Warningf("window info of %d is nil", window0)
|
||||
entry := m.Entries.getByWindowId(window0)
|
||||
m.removeAppEntry(entry)
|
||||
}
|
||||
@@ -198,6 +202,7 @@ func (m *Manager) handleMapNotifyEvent(ev *x.MapNotifyEvent) {
|
||||
logger.Debug("MapNotifyEvent window:", ev.Window)
|
||||
winInfo := m.registerWindow(ev.Window)
|
||||
time.AfterFunc(2*time.Second, func() {
|
||||
+ logger.Warningf("mapNotifyEvent after 2s, call identifyWindow, win: %d", winInfo.window)
|
||||
_, appInfo := m.identifyWindow(winInfo)
|
||||
m.markAppLaunched(appInfo)
|
||||
})
|
||||
diff --git a/dock/identify_window.go b/dock/identify_window.go
|
||||
index 9b433ed..e4f178e 100644
|
||||
--- a/dock/identify_window.go
|
||||
+++ b/dock/identify_window.go
|
||||
@@ -20,9 +20,11 @@
|
||||
package dock
|
||||
|
||||
import (
|
||||
+ "fmt"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
+ "time"
|
||||
|
||||
"pkg.deepin.io/lib/procfs"
|
||||
)
|
||||
@@ -59,18 +61,18 @@ func (m *Manager) identifyWindow(winInfo *WindowInfo) (innerId string, appInfo *
|
||||
logger.Debugf("identifyWindow: window id: %v, window innerId: %q",
|
||||
winInfo.window, winInfo.innerId)
|
||||
if winInfo.innerId == "" {
|
||||
- logger.Debug("identifyWindow: winInfo.innerId is empty")
|
||||
+ logger.Debugf("identifyWindow: win %d winInfo.innerId is empty", winInfo.window)
|
||||
return
|
||||
}
|
||||
|
||||
for idx, item := range m.identifyWindowFuns {
|
||||
name := item.Name
|
||||
- logger.Debugf("identifyWindow: try %s:%d", name, idx)
|
||||
+ logger.Debugf("identifyWindow %d try %s:%d", winInfo.window, name, idx)
|
||||
innerId, appInfo = item.Fn(m, winInfo)
|
||||
if innerId != "" {
|
||||
// success
|
||||
- logger.Debugf("identifyWindow by %s success, innerId: %q, appInfo: %v",
|
||||
- name, innerId, appInfo)
|
||||
+ logger.Debugf("identifyWindow %d by %s success, innerId: %q, appInfo: %v",
|
||||
+ winInfo.window, name, innerId, appInfo)
|
||||
// NOTE: if name == "Pid", appInfo may be nil
|
||||
if appInfo != nil {
|
||||
fixedAppInfo := fixAutostartAppInfo(appInfo)
|
||||
@@ -101,8 +103,9 @@ func fixAutostartAppInfo(appInfo *AppInfo) *AppInfo {
|
||||
}
|
||||
|
||||
func identifyWindowByScratch(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByScratch win: %d ", winInfo.window)
|
||||
desktopFile := filepath.Join(scratchDir, addDesktopExt(winInfo.innerId))
|
||||
- logger.Debugf("try scratch desktop file: %q", desktopFile)
|
||||
+ logger.Debugf("%s try scratch desktop file: %q", msgPrefix, desktopFile)
|
||||
appInfo := NewAppInfoFromFile(desktopFile)
|
||||
if appInfo != nil {
|
||||
// success
|
||||
@@ -113,8 +116,9 @@ func identifyWindowByScratch(m *Manager, winInfo *WindowInfo) (string, *AppInfo)
|
||||
}
|
||||
|
||||
func identifyWindowByPid(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByPid win: %d ", winInfo.window)
|
||||
if winInfo.pid > 10 {
|
||||
- logger.Debugf("identifyWindowByPid: pid: %d", winInfo.pid)
|
||||
+ logger.Debugf("%s pid: %d", msgPrefix, winInfo.pid)
|
||||
entry := m.Entries.GetByWindowPid(winInfo.pid)
|
||||
if entry != nil {
|
||||
// success
|
||||
@@ -126,8 +130,9 @@ func identifyWindowByPid(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
}
|
||||
|
||||
func identifyWindowByGtkAppId(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByGtkAppId win: %d ", winInfo.window)
|
||||
gtkAppId := winInfo.gtkAppId
|
||||
- logger.Debugf("identifyWindowByGtkAppId: gtkAppId: %q", gtkAppId)
|
||||
+ logger.Debugf("%s gtkAppId: %q", msgPrefix, gtkAppId)
|
||||
if gtkAppId != "" {
|
||||
appInfo := NewAppInfo(gtkAppId)
|
||||
if appInfo != nil {
|
||||
@@ -140,8 +145,9 @@ func identifyWindowByGtkAppId(m *Manager, winInfo *WindowInfo) (string, *AppInfo
|
||||
}
|
||||
|
||||
func identifyWindowByFlatpakAppID(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByFlatpakAppID win: %d ", winInfo.window)
|
||||
flatpakRef := winInfo.flatpakAppID
|
||||
- logger.Debugf("identifyWindowByFlatpakAppID: flatpak ref is %q", flatpakRef)
|
||||
+ logger.Debugf("%s flatpak ref is %q", msgPrefix, flatpakRef)
|
||||
if strings.HasPrefix(flatpakRef, "app/") {
|
||||
parts := strings.Split(flatpakRef, "/")
|
||||
if len(parts) > 1 {
|
||||
@@ -204,12 +210,13 @@ var crxAppIdMap = map[string]string{
|
||||
}
|
||||
|
||||
func identifyWindowByCrxId(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByCrxId win: %d ", winInfo.window)
|
||||
if winInfo.wmClass != nil &&
|
||||
strings.EqualFold(winInfo.wmClass.Class, "chromium-browser") &&
|
||||
strings.HasPrefix(winInfo.wmClass.Instance, "crx_") {
|
||||
|
||||
appId, ok := crxAppIdMap[winInfo.wmClass.Instance]
|
||||
- logger.Debug("identifyWindowByCrxId", appId)
|
||||
+ logger.Debug(msgPrefix, "appId:", appId)
|
||||
if ok {
|
||||
appInfo := NewAppInfo(appId)
|
||||
if appInfo != nil {
|
||||
@@ -223,6 +230,7 @@ func identifyWindowByCrxId(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
}
|
||||
|
||||
func identifyWindowByCmdlineTurboBooster(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByCmdlineTurboBooster win: %d ", winInfo.window)
|
||||
pid := winInfo.pid
|
||||
process := winInfo.process
|
||||
if process != nil && pid != 0 {
|
||||
@@ -233,7 +241,7 @@ func identifyWindowByCmdlineTurboBooster(m *Manager, winInfo *WindowInfo) (strin
|
||||
} else if strings.Contains(process.cmdline[0], "/applications/") {
|
||||
matches, err := filepath.Glob(process.cmdline[0] + "*")
|
||||
if err != nil {
|
||||
- logger.Warning("filepath.Glob err:", err)
|
||||
+ logger.Warning(msgPrefix, "filepath.Glob err:", err)
|
||||
return "", nil
|
||||
}
|
||||
if len(matches) > 0 && strings.HasSuffix(matches[0], desktopExt) {
|
||||
@@ -242,7 +250,7 @@ func identifyWindowByCmdlineTurboBooster(m *Manager, winInfo *WindowInfo) (strin
|
||||
}
|
||||
|
||||
if desktopFile != "" {
|
||||
- logger.Debugf("identifyWindowByCmdlineTurboBooster: desktopFile: %s", desktopFile)
|
||||
+ logger.Debugf("%s desktopFile: %s", msgPrefix, desktopFile)
|
||||
appInfo := NewAppInfoFromFile(desktopFile)
|
||||
if appInfo != nil {
|
||||
// success
|
||||
@@ -257,6 +265,7 @@ func identifyWindowByCmdlineTurboBooster(m *Manager, winInfo *WindowInfo) (strin
|
||||
}
|
||||
|
||||
func identifyWindowByPidEnv(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByPidEnv win: %d ", winInfo.window)
|
||||
pid := winInfo.pid
|
||||
process := winInfo.process
|
||||
if process != nil && pid != 0 {
|
||||
@@ -264,18 +273,22 @@ func identifyWindowByPidEnv(m *Manager, winInfo *WindowInfo) (string, *AppInfo)
|
||||
launchedDesktopFilePid, _ := strconv.ParseUint(
|
||||
process.environ.Get("GIO_LAUNCHED_DESKTOP_FILE_PID"), 10, 32)
|
||||
|
||||
- logger.Debugf("identifyWindowByPidEnv: launchedDesktopFile: %q, pid: %d",
|
||||
- launchedDesktopFile, launchedDesktopFilePid)
|
||||
+ logger.Debugf("%s launchedDesktopFile: %q, pid: %d",
|
||||
+ msgPrefix, launchedDesktopFile, launchedDesktopFilePid)
|
||||
|
||||
+ // 以下 2 种情况下,才能信任环境变量 GIO_LAUNCHED_DESKTOP_FILE。
|
||||
+ // 1. 当窗口 pid 和 launchedDesktopFilePid 相同时;
|
||||
+ // 2. 当窗口的进程的父进程 id(即 ppid)和 launchedDesktopFilePid 相同,
|
||||
+ // 并且该父进程是 sh 或 bash 时。
|
||||
var try bool
|
||||
- if uint(launchedDesktopFilePid) == pid || process.ppid == 1 { // launchedDesktopFilePid可能被销毁,process变成孤儿进程
|
||||
+ if uint(launchedDesktopFilePid) == pid {
|
||||
try = true
|
||||
} else if uint(launchedDesktopFilePid) == process.ppid && process.ppid != 0 {
|
||||
- logger.Debug("ppid equal")
|
||||
+ logger.Debug(msgPrefix, "ppid equal")
|
||||
parentProcess := procfs.Process(process.ppid)
|
||||
cmdline, err := parentProcess.Cmdline()
|
||||
if err == nil && len(cmdline) > 0 {
|
||||
- logger.Debugf("parent process cmdline: %#v", cmdline)
|
||||
+ logger.Debugf("%s parent process cmdline: %#v", msgPrefix, cmdline)
|
||||
base := filepath.Base(cmdline[0])
|
||||
if base == "sh" || base == "bash" {
|
||||
try = true
|
||||
@@ -296,11 +309,12 @@ func identifyWindowByPidEnv(m *Manager, winInfo *WindowInfo) (string, *AppInfo)
|
||||
}
|
||||
|
||||
func identifyWindowByRule(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByRule win: %d ", winInfo.window)
|
||||
ret := m.windowPatterns.Match(winInfo)
|
||||
if ret == "" {
|
||||
return "", nil
|
||||
}
|
||||
- logger.Debug("identifyWindowByRule ret:", ret)
|
||||
+ logger.Debug(msgPrefix, "patterns match result:", ret)
|
||||
// parse ret
|
||||
// id=$appId or env
|
||||
var appInfo *AppInfo
|
||||
@@ -356,12 +370,21 @@ func identifyWindowByWmClass(m *Manager, winInfo *WindowInfo) (string, *AppInfo)
|
||||
}
|
||||
|
||||
func identifyWindowByBamf(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
- // bamf
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByBamf win: %d ", winInfo.window)
|
||||
win := winInfo.window
|
||||
- desktop, err := getDesktopFromWindowByBamf(win)
|
||||
- if err != nil {
|
||||
- logger.Warning(err)
|
||||
- return "", nil
|
||||
+ desktop := ""
|
||||
+ // 重试 bamf 识别,yozo office 的窗口经常要第二次时才能识别到。
|
||||
+ for i := 0; i < 3; i++ {
|
||||
+ var err error
|
||||
+ desktop, err = getDesktopFromWindowByBamf(win)
|
||||
+ logger.Debugf("%s get desktop i: %d, desktop: %q", msgPrefix, i, desktop)
|
||||
+ if err != nil {
|
||||
+ logger.Warning(msgPrefix, "get desktop failed:", err)
|
||||
+ }
|
||||
+ if desktop != "" {
|
||||
+ break
|
||||
+ }
|
||||
+ time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
|
||||
if desktop != "" {
|
||||
@@ -375,6 +398,7 @@ func identifyWindowByBamf(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
}
|
||||
|
||||
func identifyWindowByCmdlineXWalk(m *Manager, winInfo *WindowInfo) (string, *AppInfo) {
|
||||
+ msgPrefix := fmt.Sprintf("identifyWindowByCmdlineXWalk win: %d ", winInfo.window)
|
||||
process := winInfo.process
|
||||
if process == nil || winInfo.pid == 0 {
|
||||
return "", nil
|
||||
@@ -386,7 +410,7 @@ func identifyWindowByCmdlineXWalk(m *Manager, winInfo *WindowInfo) (string, *App
|
||||
return "", nil
|
||||
}
|
||||
lastArg := args[len(args)-1]
|
||||
- logger.Debugf("lastArg: %q", lastArg)
|
||||
+ logger.Debugf("%s lastArg: %q", msgPrefix, lastArg)
|
||||
|
||||
if filepath.Base(lastArg) == "manifest.json" {
|
||||
appId := filepath.Base(filepath.Dir(lastArg))
|
||||
--
|
||||
2.18.4
|
||||
|
||||
228
0001-fix-fonts-gb-st-super.patch
Normal file
228
0001-fix-fonts-gb-st-super.patch
Normal file
@ -0,0 +1,228 @@
|
||||
From 4b2322bf4d3076f50a1a966f0396980ba052b468 Mon Sep 17 00:00:00 2001
|
||||
From: lichangze <lichangze@uniontech.com>
|
||||
Date: Wed, 11 Jan 2023 11:22:13 +0800
|
||||
Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=84=E9=81=BFfonts-gb-st-super?=
|
||||
=?UTF-8?q?=E5=AD=97=E4=BD=93=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
由于fonts-gb-st-super字体的lang字段中没有zh-cn等中文字段,因此dde-daemon过滤掉了该字体.
|
||||
增加不规范字体显示白名单,将该字体加入白名单中
|
||||
|
||||
Log: 规避fonts-gb-st-super字体不显示问题
|
||||
Bug: https://pms.uniontech.com/bug-view-182839.html
|
||||
Influence: 字体过滤条件
|
||||
Change-Id: I0d24b3c587201e69d412a18777b14ccec19c561b
|
||||
---
|
||||
appearance/appearance.go | 5 +-
|
||||
appearance/fonts/wrapper.go | 17 ++++-
|
||||
appearance/manager.go | 65 +++++++++++++++++--
|
||||
.../org.deepin.dde.daemon.appearance.json | 17 +++++
|
||||
4 files changed, 94 insertions(+), 10 deletions(-)
|
||||
create mode 100644 misc/dsg-configs/org.deepin.dde.daemon.appearance.json
|
||||
|
||||
diff --git a/appearance/appearance.go b/appearance/appearance.go
|
||||
index 08f19b01..717211ee 100644
|
||||
--- a/appearance/appearance.go
|
||||
+++ b/appearance/appearance.go
|
||||
@@ -10,10 +10,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/godbus/dbus"
|
||||
- "github.com/linuxdeepin/dde-daemon/appearance/background"
|
||||
- "github.com/linuxdeepin/dde-daemon/loader"
|
||||
"github.com/linuxdeepin/go-lib/dbusutil"
|
||||
"github.com/linuxdeepin/go-lib/log"
|
||||
+
|
||||
+ "github.com/linuxdeepin/dde-daemon/appearance/background"
|
||||
+ "github.com/linuxdeepin/dde-daemon/loader"
|
||||
)
|
||||
|
||||
var (
|
||||
diff --git a/appearance/fonts/wrapper.go b/appearance/fonts/wrapper.go
|
||||
index 97fdf598..86ff3a92 100644
|
||||
--- a/appearance/fonts/wrapper.go
|
||||
+++ b/appearance/fonts/wrapper.go
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
+ "sync"
|
||||
"unsafe"
|
||||
|
||||
"github.com/linuxdeepin/go-lib/strv"
|
||||
@@ -33,6 +34,11 @@ var (
|
||||
langReg = regexp.MustCompile("_")
|
||||
)
|
||||
|
||||
+var (
|
||||
+ _irregularFontWhiteList strv.Strv
|
||||
+ _irregularFontWhiteListMu sync.Mutex
|
||||
+)
|
||||
+
|
||||
var familyBlacklist = strv.Strv([]string{
|
||||
// font family names of Deepin Open Symbol Fonts:
|
||||
"Symbol",
|
||||
@@ -149,15 +155,16 @@ func fcInfoToFamily(cInfo *C.FcInfo) *Family {
|
||||
if familyBlacklist.Contains(family) {
|
||||
return nil
|
||||
}
|
||||
-
|
||||
// info.Deletable = isDeletable(info.File)
|
||||
langs := strings.Split(C.GoString(cInfo.lang), defaultLangDelim)
|
||||
+ _irregularFontWhiteListMu.Lock()
|
||||
+ defer _irregularFontWhiteListMu.Unlock()
|
||||
return &Family{
|
||||
Id: family,
|
||||
Name: getItemByIndex(indexOf(getCurLang(), familyLang), families),
|
||||
Styles: strings.Split(C.GoString(cInfo.style), defaultNameDelim),
|
||||
Monospace: isMonospace(family, C.GoString(cInfo.spacing)),
|
||||
- Show: strv.Strv(langs).Contains(getCurLang()),
|
||||
+ Show: _irregularFontWhiteList.Contains(family) || strv.Strv(langs).Contains(getCurLang()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,3 +240,9 @@ func getLangFromLocale(locale string) string {
|
||||
}
|
||||
return lang
|
||||
}
|
||||
+
|
||||
+func SetIrregularFontWhiteList(whiteList strv.Strv) {
|
||||
+ _irregularFontWhiteListMu.Lock()
|
||||
+ _irregularFontWhiteList = whiteList
|
||||
+ _irregularFontWhiteListMu.Unlock()
|
||||
+}
|
||||
diff --git a/appearance/manager.go b/appearance/manager.go
|
||||
index beee00d2..20687456 100644
|
||||
--- a/appearance/manager.go
|
||||
+++ b/appearance/manager.go
|
||||
@@ -24,18 +24,13 @@ import (
|
||||
"github.com/fsnotify/fsnotify"
|
||||
dbus "github.com/godbus/dbus"
|
||||
"github.com/linuxdeepin/dde-api/theme_thumb"
|
||||
- "github.com/linuxdeepin/dde-daemon/appearance/background"
|
||||
- "github.com/linuxdeepin/dde-daemon/appearance/fonts"
|
||||
- "github.com/linuxdeepin/dde-daemon/appearance/subthemes"
|
||||
- "github.com/linuxdeepin/dde-daemon/common/dsync"
|
||||
- ddbus "github.com/linuxdeepin/dde-daemon/dbus"
|
||||
- "github.com/linuxdeepin/dde-daemon/session/common"
|
||||
accounts "github.com/linuxdeepin/go-dbus-factory/com.deepin.daemon.accounts"
|
||||
display "github.com/linuxdeepin/go-dbus-factory/com.deepin.daemon.display"
|
||||
imageeffect "github.com/linuxdeepin/go-dbus-factory/com.deepin.daemon.imageeffect"
|
||||
sessiontimedate "github.com/linuxdeepin/go-dbus-factory/com.deepin.daemon.timedate"
|
||||
sessionmanager "github.com/linuxdeepin/go-dbus-factory/com.deepin.sessionmanager"
|
||||
wm "github.com/linuxdeepin/go-dbus-factory/com.deepin.wm"
|
||||
+ configManager "github.com/linuxdeepin/go-dbus-factory/org.desktopspec.ConfigManager"
|
||||
login1 "github.com/linuxdeepin/go-dbus-factory/org.freedesktop.login1"
|
||||
timedate "github.com/linuxdeepin/go-dbus-factory/org.freedesktop.timedate1"
|
||||
gio "github.com/linuxdeepin/go-gir/gio-2.0"
|
||||
@@ -48,6 +43,13 @@ import (
|
||||
"github.com/linuxdeepin/go-lib/xdg/basedir"
|
||||
x "github.com/linuxdeepin/go-x11-client"
|
||||
"github.com/linuxdeepin/go-x11-client/ext/randr"
|
||||
+
|
||||
+ "github.com/linuxdeepin/dde-daemon/appearance/background"
|
||||
+ "github.com/linuxdeepin/dde-daemon/appearance/fonts"
|
||||
+ "github.com/linuxdeepin/dde-daemon/appearance/subthemes"
|
||||
+ "github.com/linuxdeepin/dde-daemon/common/dsync"
|
||||
+ ddbus "github.com/linuxdeepin/dde-daemon/dbus"
|
||||
+ "github.com/linuxdeepin/dde-daemon/session/common"
|
||||
)
|
||||
|
||||
//go:generate dbusutil-gen em -type Manager
|
||||
@@ -103,6 +105,12 @@ const (
|
||||
dbusInterface = dbusServiceName
|
||||
)
|
||||
|
||||
+const (
|
||||
+ dsettingsAppID = "org.deepin.dde.daemon"
|
||||
+ dsettingsAppearanceName = "org.deepin.dde.daemon.appearance"
|
||||
+ dsettingsIrregularFontWhiteListKey = "irregularFontWhiteList"
|
||||
+)
|
||||
+
|
||||
var wsConfigFile = filepath.Join(basedir.GetUserConfigDir(), "deepin/dde-daemon/appearance/wallpaper-slideshow.json")
|
||||
|
||||
// Manager shows current themes and fonts settings, emit 'Changed' signal if modified
|
||||
@@ -616,6 +624,9 @@ func (m *Manager) init() error {
|
||||
logger.Warning("failed to set cursor theme:", err)
|
||||
}
|
||||
|
||||
+ // Init IrregularFontWhiteList
|
||||
+ m.initAppearanceDSettings()
|
||||
+
|
||||
// Init theme list
|
||||
time.AfterFunc(time.Second*10, func() {
|
||||
if !dutils.IsFileExist(fonts.DeepinFontConfig) {
|
||||
@@ -1612,3 +1623,45 @@ func (m *Manager) iso6709Parsing(city, coordinates string) {
|
||||
cdn.latitude = lat
|
||||
m.coordinateMap[city] = &cdn
|
||||
}
|
||||
+
|
||||
+func (m *Manager) initAppearanceDSettings() {
|
||||
+ ds := configManager.NewConfigManager(m.sysSigLoop.Conn())
|
||||
+
|
||||
+ appearancePath, err := ds.AcquireManager(0, dsettingsAppID, dsettingsAppearanceName, "")
|
||||
+ if err != nil {
|
||||
+ logger.Warning(err)
|
||||
+ return
|
||||
+ }
|
||||
+
|
||||
+ dsAppearance, err := configManager.NewManager(m.sysSigLoop.Conn(), appearancePath)
|
||||
+ if err != nil {
|
||||
+ logger.Warning(err)
|
||||
+ return
|
||||
+ }
|
||||
+
|
||||
+ getIrregularFontWhiteListKey := func() {
|
||||
+ v, err := dsAppearance.Value(0, dsettingsIrregularFontWhiteListKey)
|
||||
+ if err != nil {
|
||||
+ logger.Warning(err)
|
||||
+ return
|
||||
+ }
|
||||
+ var irregularFontWhiteListKey strv.Strv
|
||||
+ itemList := v.Value().([]dbus.Variant)
|
||||
+ for _, i := range itemList {
|
||||
+ irregularFontWhiteListKey = append(irregularFontWhiteListKey, i.Value().(string))
|
||||
+ }
|
||||
+ fonts.SetIrregularFontWhiteList(irregularFontWhiteListKey)
|
||||
+ }
|
||||
+
|
||||
+ getIrregularFontWhiteListKey()
|
||||
+
|
||||
+ dsAppearance.InitSignalExt(m.sysSigLoop, true)
|
||||
+ _, err = dsAppearance.ConnectValueChanged(func(key string) {
|
||||
+ if key == dsettingsIrregularFontWhiteListKey {
|
||||
+ getIrregularFontWhiteListKey()
|
||||
+ }
|
||||
+ })
|
||||
+ if err != nil {
|
||||
+ logger.Warning(err)
|
||||
+ }
|
||||
+}
|
||||
diff --git a/misc/dsg-configs/org.deepin.dde.daemon.appearance.json b/misc/dsg-configs/org.deepin.dde.daemon.appearance.json
|
||||
new file mode 100644
|
||||
index 00000000..8fb7c853
|
||||
--- /dev/null
|
||||
+++ b/misc/dsg-configs/org.deepin.dde.daemon.appearance.json
|
||||
@@ -0,0 +1,17 @@
|
||||
+{
|
||||
+ "magic": "dsg.config.meta",
|
||||
+ "version": "1.0",
|
||||
+ "contents": {
|
||||
+ "irregularFontWhiteList": {
|
||||
+ "value": ["GB_SS_GB18030_Extended"],
|
||||
+ "serial": 0,
|
||||
+ "flags": [],
|
||||
+ "global": true,
|
||||
+ "name": "IrregularFontWhiteList",
|
||||
+ "name[zh_CN]": "不规范字体白名单",
|
||||
+ "description": "不规范字体白名单,白名单中字体show字段为true",
|
||||
+ "permissions": "read",
|
||||
+ "visibility": "private"
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.20.1
|
||||
|
||||
25
0002-donot-set-cpu-mode-while-initlizing.patch
Normal file
25
0002-donot-set-cpu-mode-while-initlizing.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 40c411464f47383229ee110398e4ad1d18c5fa6d Mon Sep 17 00:00:00 2001
|
||||
From: root <root@localhost.localdomain>
|
||||
Date: Tue, 11 Apr 2023 09:30:17 +0800
|
||||
Subject: [PATCH] no setting cpu mode while initlizing
|
||||
|
||||
---
|
||||
system/power/manager.go | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/system/power/manager.go b/system/power/manager.go
|
||||
index 7a0737c..dbe1018 100644
|
||||
--- a/system/power/manager.go
|
||||
+++ b/system/power/manager.go
|
||||
@@ -131,7 +131,7 @@ func newManager(service *dbusutil.Service) (*Manager, error) {
|
||||
cpus: NewCpuHandlers(),
|
||||
}
|
||||
|
||||
- m.refreshSystemPowerPerformance()
|
||||
+ //m.refreshSystemPowerPerformance()
|
||||
|
||||
err := m.init()
|
||||
if err != nil {
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
diff -Nuar dde-daemon-5.14.122/bin/dde-system-daemon/main.go dde-daemon-5.14.122.new/bin/dde-system-daemon/main.go
|
||||
--- dde-daemon-5.14.122/bin/dde-system-daemon/main.go 2023-04-25 11:19:13.542003330 +0800
|
||||
+++ dde-daemon-5.14.122.new/bin/dde-system-daemon/main.go 2023-04-25 11:19:47.070391949 +0800
|
||||
@@ -70,8 +70,15 @@
|
||||
if err != nil {
|
||||
logger.Fatal("failed to call NameHasOwner:", err)
|
||||
}
|
||||
+
|
||||
if hasOwner {
|
||||
logger.Warningf("name %q already has the owner", dbusServiceName)
|
||||
+ // avoid faile start account information
|
||||
+ // first is launched by dbus ,second by systemd ,when first success ,the second just report ok
|
||||
+ Ippid := os.Getppid()
|
||||
+ if Ippid ==1 {
|
||||
+ os.Exit(0)
|
||||
+ }
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Binary file not shown.
BIN
dde-daemon-5.14.122.tar.gz
Normal file
BIN
dde-daemon-5.14.122.tar.gz
Normal file
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
%global _smp_mflags -j1
|
||||
|
||||
##%global debug_package %{nil}
|
||||
%global debug_package %{nil}
|
||||
%global _unpackaged_files_terminate_build 0
|
||||
%global _missing_build_ids_terminate_build 0
|
||||
%define __debug_install_post \
|
||||
@ -11,16 +11,18 @@
|
||||
%global release_name server-industry
|
||||
|
||||
Name: dde-daemon
|
||||
Version: 5.13.85.8
|
||||
Release: 4
|
||||
Version: 5.14.122
|
||||
Release: 1
|
||||
Summary: Daemon handling the DDE session settings
|
||||
License: GPLv3
|
||||
URL: http://shuttle.corp.deepin.com/cache/tasks/18802/unstable-amd64/
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Source1: vendor.tar.gz
|
||||
Source2: %{sname}.sysusers
|
||||
#Patch1: 0001-Fix-the-system-monitor-displaying-a-scene.patch
|
||||
Patch1: fix-the-issue-enabling-module-repeatly.patch
|
||||
Patch1: 0001-fix-fonts-gb-st-super.patch
|
||||
Patch2: 0002-donot-set-cpu-mode-while-initlizing.patch
|
||||
Patch3: 0003-dde-daemon-uos-fix-failed-to-start-accounts-service.patch
|
||||
|
||||
|
||||
BuildRequires: python3
|
||||
BuildRequires: golang
|
||||
@ -49,6 +51,7 @@ BuildRequires: libddcutil-devel
|
||||
BuildRequires: pkgconfig(sqlite3)
|
||||
BuildRequires: dde-api-devel
|
||||
BuildRequires: libX11-devel
|
||||
BuildRequires: gcc-g++
|
||||
|
||||
Requires: bluez-libs
|
||||
Requires: deepin-desktop-base
|
||||
@ -73,9 +76,12 @@ Daemon handling the DDE session settings
|
||||
%autosetup -p1 -n %{name}-%{version}
|
||||
tar -xf %{SOURCE1}
|
||||
patch langselector/locale.go < rpm/locale.go.patch
|
||||
patch accounts/users/passwd.go < rpm/passwd.go.patch
|
||||
|
||||
# Fix library exec path
|
||||
sed -i '/deepin/s|lib|libexec|' Makefile
|
||||
sed -i '/systemd/s|lib|usr/lib|' Makefile
|
||||
sed -i 's:/lib/udev/rules.d:%{_udevrulesdir}:' Makefile
|
||||
sed -i '/${DESTDIR}\/usr\/lib\/deepin-daemon\/service-trigger/s|${DESTDIR}/usr/lib/deepin-daemon/service-trigger|${DESTDIR}/usr/libexec/deepin-daemon/service-trigger|g' Makefile
|
||||
sed -i '/${DESTDIR}${PREFIX}\/lib\/deepin-daemon/s|${DESTDIR}${PREFIX}/lib/deepin-daemon|${DESTDIR}${PREFIX}/usr/libexec/deepin-daemon|g' Makefile
|
||||
sed -i 's|lib/NetworkManager|libexec|' network/utils_test.go
|
||||
@ -84,7 +90,10 @@ for file in $(grep "/usr/lib/deepin-daemon" * -nR |awk -F: '{print $1}')
|
||||
do
|
||||
sed -i 's|/usr/lib/deepin-daemon|/usr/libexec/deepin-daemon|g' $file
|
||||
done
|
||||
|
||||
for file in $(grep "/usr/lib/deepin-api" * -nR | awk -F: '{print $1}')
|
||||
do
|
||||
sed -i 's|/usr/lib/deepin-api|%{_libexecdir}/deepin-api|g' $file
|
||||
done
|
||||
# Fix grub.cfg path
|
||||
sed -i 's|boot/grub|boot/grub2|' grub2/{grub2,grub_params,theme}.go
|
||||
|
||||
@ -115,18 +124,31 @@ EOF
|
||||
# Replace reference of google-chrome to chromium-browser
|
||||
sed -i 's/google-chrome/chromium-browser/g' misc/dde-daemon/mime/data.json
|
||||
|
||||
# grbu2 获取os num的忽略标题修改 UnionTech OS -> UOS
|
||||
sed -i 's|UnionTech OS|UOS|' grub2/grub_params.go
|
||||
|
||||
%build
|
||||
go env -w GO111MODULE=auto
|
||||
export GOPATH=%{_builddir}/%{name}-%{version}/vendor:$GOPATH
|
||||
go env -w GO111MODULE="off"
|
||||
%ifarch loongarch64
|
||||
export CGO_ENABLED=1
|
||||
export GOOS=linux
|
||||
%endif
|
||||
|
||||
export GOPATH=/usr/share/gocode:%{_builddir}/%{name}-%{version}/vendor:$GOPATH
|
||||
|
||||
BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')"
|
||||
%make_build GO_BUILD_FLAGS=-trimpath GOBUILD="go build -compiler gc -ldflags \"-s -B $BUILDID\""
|
||||
#make GOPATH=/usr/share/gocode
|
||||
|
||||
%install
|
||||
%ifarch loongarch64
|
||||
export CGO_ENABLED=1
|
||||
export GOOS=linux
|
||||
%endif
|
||||
|
||||
BUILDID="0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')"
|
||||
export GOPATH=%{_builddir}/%{name}-%{version}/vendor:$GOPATH
|
||||
%make_install PAM_MODULE_DIR=%{_libdir}/security GOBUILD="go build -compiler gc -ldflags \"-B $BUILDID\""
|
||||
export GOPATH=/usr/share/gocode:%{_builddir}/%{name}-%{version}/vendor:$GOPATH
|
||||
%make_install PAM_MODULE_DIR=%{_libdir}/security GOBUILD="go build -compiler gc -ldflags \"-s -B $BUILDID\""
|
||||
|
||||
install -Dm644 %{SOURCE2} %{buildroot}/usr/lib/sysusers.d/%{sname}.conf
|
||||
|
||||
@ -163,8 +185,8 @@ fi
|
||||
%files -f %{name}.lang
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
%{_sysconfdir}/deepin/grub2_edit_auth.conf
|
||||
%{_sysconfdir}/default/grub.d/10_deepin.cfg
|
||||
%{_sysconfdir}/grub.d/35_deepin_gfxmode
|
||||
%{_sysconfdir}/pam.d/deepin-auth-keyboard
|
||||
%{_libexecdir}/%{sname}/
|
||||
%{_prefix}/lib/systemd/logind.conf.d/10-%{sname}.conf
|
||||
@ -180,15 +202,21 @@ fi
|
||||
%{_sysconfdir}/acpi/actions/deepin_lid.sh
|
||||
%{_sysconfdir}/acpi/events/deepin_lid
|
||||
%{_sysconfdir}/pulse/daemon.conf.d/10-deepin.conf
|
||||
/lib/udev/rules.d/80-deepin-fprintd.rules
|
||||
%{_udevrulesdir}/80-deepin-fprintd.rules
|
||||
/var/lib/polkit-1/localauthority/10-vendor.d/com.deepin.daemon.Fprintd.pkla
|
||||
/lib/systemd/system/dbus-com.deepin.dde.lockservice.service
|
||||
/lib/systemd/system/deepin-accounts-daemon.service
|
||||
%{_unitdir}/dbus-com.deepin.dde.lockservice.service
|
||||
%{_unitdir}/deepin-accounts-daemon.service
|
||||
%{_sysusersdir}/%{sname}.conf
|
||||
/etc/NetworkManager/conf.d/deepin.dde.daemon.conf
|
||||
/etc/lightdm/deepin/xsettingsd.conf
|
||||
%{_usr}/libexec/dde-daemon/keybinding/shortcut-dde-grand-search.sh
|
||||
%{_datadir}/deepin/scheduler/config.json
|
||||
%{_datadir}/dsg/configs/org.deepin.dde.daemon/
|
||||
|
||||
%changelog
|
||||
* Mon Jul 31 2023 leeffo <liweiganga@uniontech.com> - 5.14.122-1
|
||||
- upgrade to version 5.14.122
|
||||
|
||||
* Fri Jul 21 2023 zhaoshuang <zhaoshuang@uniontech.com> - 5.13.85.8-4
|
||||
- fix: fix the issue enabling module repeatly
|
||||
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
From cbc116c79d0783fa7e280b15758fd19fe2a06d67 Mon Sep 17 00:00:00 2001
|
||||
From: kkz <zhaoshuang@uniontech.com>
|
||||
Date: Fri, 21 Jul 2023 11:18:50 +0800
|
||||
Subject: [PATCH] fix: fix the issue enabling module repeatly
|
||||
|
||||
---
|
||||
loader/loader.go | 10 ++++++++++
|
||||
loader/module.go | 7 ++++---
|
||||
2 files changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/loader/loader.go b/loader/loader.go
|
||||
index d218ab6..b34e9e8 100644
|
||||
--- a/loader/loader.go
|
||||
+++ b/loader/loader.go
|
||||
@@ -164,6 +164,11 @@ func (l *Loader) EnableModules(enablingModules []string, disableModules []string
|
||||
|
||||
go func() {
|
||||
l.log.Info("enable module", name)
|
||||
+ if module.IsEnable() == true {
|
||||
+ l.log.Infof("module %s has been enabled", name)
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
startTime := time.Now()
|
||||
|
||||
// wait for its dependency
|
||||
@@ -185,6 +190,11 @@ func (l *Loader) EnableModules(enablingModules []string, disableModules []string
|
||||
|
||||
for _, n := range nodes {
|
||||
m := l.modules[n.ID]
|
||||
+
|
||||
+ if m.IsEnable() == true {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
m.WaitEnable()
|
||||
}
|
||||
|
||||
diff --git a/loader/module.go b/loader/module.go
|
||||
index 325a572..b4320db 100644
|
||||
--- a/loader/module.go
|
||||
+++ b/loader/module.go
|
||||
@@ -54,9 +54,10 @@ type ModuleBase struct {
|
||||
|
||||
func NewModuleBase(name string, impl ModuleImpl, logger *log.Logger) *ModuleBase {
|
||||
m := &ModuleBase{
|
||||
- name: name,
|
||||
- impl: impl,
|
||||
- log: logger,
|
||||
+ name: name,
|
||||
+ impl: impl,
|
||||
+ log: logger,
|
||||
+ enabled:false,
|
||||
}
|
||||
|
||||
// 此为等待「enabled」的 WaitGroup,故在 enable 完成之前,需要一直为等待状态。
|
||||
--
|
||||
2.27.0
|
||||
|
||||
BIN
vendor.tar.gz
BIN
vendor.tar.gz
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user