Skip to content

Commit

Permalink
Develop/snipe (#652)
Browse files Browse the repository at this point in the history
* feat: 支持控制中心个性化头像设置

修改账户头像的目录,支持账户个性化头像设置

Log: 实现控制中心个性化头像设置功能
Resolve: linuxdeepin/developer-center#3796
Influence: 控制中心账户头像设置

* chore: cherry-pick v23 patchs

fix: 单指从触控屏右侧边缘划入打开的不是小组件面板
fix: ScalePlymouth适配社区版
feat: 支持控制中心个性化头像设

* chore: 修复dde-system-daemon崩溃的问题

增加判断,防止dde-account-faces没有更新时用户头像不存在导致dde-system-daemon崩溃

Log: 修复dde-system-daemon崩溃的问题

* fix: 登录界面头像显示异常

新增默认显示头像, 用户自定义头像保存到系统目录(/var/lib/AccountsService/icons), 防止登录界面读取不到

Log: 修复登录界面头像显示异常异常的问题
Resolve: linuxdeepin/developer-center#4041
Influence: 用户头像正常显示

* feat: 更改默认头像

账户默认头像换成小浣熊头像

Log: 更改用户默认头像
Influence: 账户头像显示
(cherry picked from commit 82de4e6)

* feat: use dlopen searches library when dpkg-architecture not available

Log: use dlopen searches library when dpkg-architecture not available
(cherry picked from commit 52eccc1)

* fix: 登录界面头像显示异常

新增默认显示头像, 用户自定义头像保存到系统目录(/var/lib/AccountsService/icons), 防止登录界面读取不到

Log: 修复登录界面头像显示异常异常的问题
Resolve: linuxdeepin/developer-center#4041
Influence: 用户头像正常显示

* fix: 登录界面头像显示异常

新增默认显示头像, 用户自定义头像保存到系统目录(/var/lib/AccountsService/icons), 防止登录界面读取不到

Log: 修复登录界面头像显示异常异常的问题
Resolve: linuxdeepin/developer-center#4041
Influence: 用户头像正常显示

* chore: Makefile can use go mod

move GO111MODULE=off to debain rules

Log:

(cherry picked from commit 0c297a1)

* chore: Sync by linuxdeepin/.github@2e5e092

sync by github workflow

Log: none
Influence: none
(cherry picked from commit 243e7e7)

* chore: remove unused file

remove unused file

(cherry picked from commit 0ad88f4)

* fix: 第一次进入登陆界面界面缩放异常

dde-daemon 通过xsettingsd.conf提供了默认的缩放(xft/DPI 98304->缩放比1.0)
导致lightdm-deepin-greeter不会去自己计算缩放比, 导致界面缩放比异常

Log: 解决第一次进入登陆界面界面缩放异常的问题
Resolve: linuxdeepin/developer-center#3594
(cherry picked from commit c7aadc8)

* chore: update tx config

update tx config

Log:
(cherry picked from commit 0a0898e)

* chore(CI): Update obs tag build workflow

use obs unstable package directly

log:
(cherry picked from commit 735deb1)

* feat: 添加鼠标和触摸板开关接口

添加鼠标和触摸板开关接口

Log:

(cherry picked from commit f2ee58c)

* feat: 添加鼠标和触摸板使能属性

添加鼠标和触摸板使能属性

Log:
(cherry picked from commit 3c69413)

* Revert "chore: Makefile can use go mod"

This reverts commit 6019d64.

* feat: search in XDG directories

Log: search in XDG directories

* chore: add gen.go

Log: add gen.go support

(cherry picked from commit 44323fd)

* feat: add locale region set

add locale region set

Log:
(cherry picked from commit 2235be1)

* chore: Sync by linuxdeepin/.github@559e911

sync by github workflow

Log: none
Influence: none
(cherry picked from commit 7d546f6)

* fix: fix daemon packaging error

use test path to test interface

Log:
(cherry picked from commit 5ab3056)

* feat: support to use pipewire

audio moudule support to use pipewire

Log:
(cherry picked from commit 6010ab4)

* feat: don't need retry 5 count to start audio server

there is already a retry mechanism for using systemd to start services
so don't need to manual to retry

Log:

(cherry picked from commit 3049a76)

* feat: add bluetooth battery

add bluetooth battery for DBus org.deepin.dde.bluetooth1.GetDevices

(cherry picked from commit 17285e8)

* feat: update battery when org.bluez.Battery1 interface added or removed

update battery when org.bluez.Battery1 interface added or removed

(cherry picked from commit 170565d)

* fix: launch incorrect pipewire service

use pipewire audio backend need to start pipewire-pulse service

Log: 修复注销后重新登录音频模块启动失败的问题
(cherry picked from commit ea21d37)

* feat: search in XDG directories

Log: search in XDG directories

* fix: tpad enable status misjudgment

tpad must be enable when mouse device not exist

Log:
(cherry picked from commit c467047)

* fix: touchpad enable status misjudgment

only DisableTpad status and TPadEnable status is false to enable touchpad

Log: fix close DisableTpad, touchpad not enable
(cherry picked from commit 77611ab)

* fix: dock bluetooth module is missing

dock depends dde-session-daemon bluetooth adapter add signal to show
bluetooth module

Log:
(cherry picked from commit a46ed1c)

* feat: add pause player interface

Log:

(cherry picked from commit 52a7dcc)

* fix: bash is not default SHELL for new user

在未传入shell参数,并且从/etc/adduser.conf配置文件中未获取到DSHELL配置时,将"/bin/bash"作为新建用户的默认SHELL,以确保终端中能够正常展示当前用户名、机器名称、当前路径信息。

Log: 修复新建用户默认SHELL为"/bin/sh",导致的终端中未展示当前用户名、机器名称、当前路径信息的问题,
Issue: linuxdeepin/developer-center#5744
(cherry picked from commit 7c65a36)

* chore: correct typos in system/network/ping.go

Log:
(cherry picked from commit 30df307)

* feat: add audio server switch support

add audio server switch support

Issue: linuxdeepin/developer-center#5819
Log: add audio server switch support

(cherry picked from commit 68065d2)

* feat: update icon name

Issue: linuxdeepin/developer-center#5819
Log: update icon name
(cherry picked from commit 0dff5f0)

* fix: wifi device not enable

when rfkill block, after system reboot,wifi device not enable when rfkill unblock again

Log:
(cherry picked from commit 1c9de93)

* fix: accounts icon save error

we must walk the accounts icon path to get right icon path

Log:
(cherry picked from commit 459b702)

* fix: remove locale region set

remove locale region set

Log:

(cherry picked from commit 1377d96)

* feat: search in XDG directories

Log: search in XDG directories

* fix: invalid timezone during set dateTime

Issue: linuxdeepin/developer-center#6925
Log:
(cherry picked from commit 7e581d7)

* fix: set the default value of statusNotifierHost to true

Issue: linuxdeepin/developer-center#4431

由于dock在daemon检查时可能未启动,导致托盘协议回退。根据 @tsic404 的建议
,在确定一定会有支持SNI规范的应用(dde-dock)启动的情况下,取消该检查。

Signed-off-by: ComixHe <[email protected]>
(cherry picked from commit 6649ed7)

* fix: fix a crash

判断 defaultSink 是否为 nil

(cherry picked from commit dbbc25e)

* fix: the dock icon of deepin-terminal quake mode is missing

Issue: linuxdeepin/developer-center#8596

* fix: archlinux build error

高版本ddcutils需要单独添加ddcutil_types.h才能保证cgo能正常构建

log:

* fix: pressing the power button opened the lock screen

应该打开关机界面

Issues: linuxdeepin/developer-center#9360

(cherry picked from commit 299a422)

* feat: TreeLand display service special handlle

TreeLand模式下,部分模块不启动(后续适配完成,恢复)

Log:
(cherry picked from commit e16a0b5)

* chore: 修改默认greeter壁纸 (#645)

修改默认greeter壁纸
Issue: linuxdeepin/developer-center#10264

Co-authored-by: fuleyi <[email protected]>
(cherry picked from commit 3e68a35)

* fix: unable to start under wayland

xeventmonitor disabled under wayland

Log:
(cherry picked from commit 36a1edc)

* chore: 修改polikit中actiond的风格

修改polikit中actiond的风格

---------

Co-authored-by: dengbo <[email protected]>
Co-authored-by: fuleyi <[email protected]>
Co-authored-by: rewine <[email protected]>
Co-authored-by: bluesky <[email protected]>
Co-authored-by: deepin-admin-bot <[email protected]>
Co-authored-by: zsien <[email protected]>
Co-authored-by: dengbo <[email protected]>
Co-authored-by: hudeng <[email protected]>
Co-authored-by: chenhongtao <[email protected]>
Co-authored-by: Cloud <[email protected]>
Co-authored-by: chenhongtao <[email protected]>
Co-authored-by: hotime <[email protected]>
Co-authored-by: Felix Yan <[email protected]>
Co-authored-by: ComixHe <[email protected]>
Co-authored-by: echengqi <echengqi@uniontech>
Co-authored-by: Zhang Dingyuan <[email protected]>
  • Loading branch information
17 people authored Sep 9, 2024
1 parent ea6505f commit 6e3a375
Show file tree
Hide file tree
Showing 376 changed files with 4,272 additions and 3,545 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/backup-to-gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ concurrency:
jobs:
backup-to-gitlabwh:
uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master
secrets:
BRIDGETOKEN: ${{ secrets.BRIDGETOKEN }}
secrets: inherit

backup-to-gitee:
uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master
secrets:
GITEE_SYNC_TOKEN: ${{ secrets.GITEE_SYNC_TOKEN }}
secrets: inherit
17 changes: 0 additions & 17 deletions .github/workflows/call-build-deb.yml

This file was deleted.

6 changes: 1 addition & 5 deletions .github/workflows/call-build-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@ on:
jobs:
check_job:
uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master
secrets:
BUILD_GPG_PRIVATE_KEY: ${{ secrets.BUILD_GPG_PRIVATE_KEY }}
BUILD_SSH_PRIVATE_KEY: ${{ secrets.BUILD_SSH_PRIVATE_KEY }}
WEBDAV_PASSWD: ${{ secrets.WEBDAV_PASSWD }}
WEBDAV_USER: ${{ secrets.WEBDAV_USER }}
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/call-chatOps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ on:
jobs:
chatopt:
uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master
secrets:
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/call-clacheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ concurrency:
jobs:
clacheck:
uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master
secrets:
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
secrets: inherit
13 changes: 0 additions & 13 deletions .github/workflows/call-tag-build.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ test_build:

tag_build:
steps:
- branch_package:
source_project: deepin:Develop:dde
source_package: %{SCM_REPOSITORY_NAME}
target_project: deepin:Unstable:dde
- trigger_services:
project: deepin:Unstable:dde
package: %{SCM_REPOSITORY_NAME}
filters:
event: tag_push

Expand Down
1 change: 1 addition & 0 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mode = developer

[o:linuxdeepin:p:deepin-desktop-environment:r:dde-daemonpot]
file_filter = misc/po/<lang>.po
minimum_perc = 0
source_file = misc/po/dde-daemon.pot
source_lang = en
type = PO
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ translate: $(addsuffix /LC_MESSAGES/dde-daemon.mo, $(addprefix out/locale/, ${LA
pot:
deepin-update-pot misc/po/locale_config.ini

POLICIES=accounts1 Grub2 Fprintd1
POLICIES=accounts grub2 fprintd
ts:
for i in $(POLICIES); do \
deepin-policy-ts-convert policy2ts misc/polkit-action/org.deepin.dde.$$i.policy.in misc/ts/org.deepin.dde.$$i.policy; \
Expand Down Expand Up @@ -224,6 +224,7 @@ install: build install-dde-data install-icons
cp -r misc/dsg-configs/*.json ${DESTDIR}${PREFIX}/share/dsg/configs/org.deepin.dde.daemon/

cp -f misc/scripts/dde-lock.sh ${DESTDIR}${PREFIX}/lib/deepin-daemon/
cp -f misc/scripts/dde-shutdown.sh ${DESTDIR}${PREFIX}/lib/deepin-daemon/
install-dde-data:
mkdir -pv ${DESTDIR}${PREFIX}/share/dde/
cp -r misc/data ${DESTDIR}${PREFIX}/share/dde/
Expand Down
4 changes: 3 additions & 1 deletion accounts1/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var (
_imageBlur *ImageBlur
_userStandardIcons []string
_accountsManager *Manager
_userCustomIcons []string
logger = log.NewLogger("daemon/accounts")
)

Expand Down Expand Up @@ -46,7 +47,8 @@ func (d *Daemon) Start() error {
if d.manager != nil {
return nil
}
_userStandardIcons = getUserStandardIcons()

_userStandardIcons, _userCustomIcons = getUserIcons()
service := loader.GetService()
d.manager = NewManager(service)
_accountsManager = d.manager
Expand Down
3 changes: 1 addition & 2 deletions accounts1/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const (
userIconsDir = actConfigDir + "/icons"
userCustomIconsDir = actConfigDir + "/icons/local"

userIconGuest = actConfigDir + "/icons/guest.png"
actConfigFile = actConfigDir + "/accounts.ini"
actConfigGroupGroup = "Accounts"
actConfigKeyGuest = "AllowGuest"
Expand Down Expand Up @@ -139,7 +138,7 @@ func NewManager(service *dbusutil.Service) *Manager {
m.usersMap = make(map[string]*User)
m.userAddedChanMap = make(map[string]chan string)

m.GuestIcon = userIconGuest
m.GuestIcon = getRandomIcon()
m.AllowGuest = isGuestUserEnabled()

m.initUsers(getUserPaths())
Expand Down
8 changes: 4 additions & 4 deletions accounts1/manager_ifc.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func (m *Manager) CreateUser(sender dbus.Sender,
if err != nil {
logger.Warningf("failed to set groups for user %s: %v", name, err)
}

// create user success
select {
case userPath, ok := <-ch:
Expand Down Expand Up @@ -266,14 +267,13 @@ func (m *Manager) FindUserByName(name string) (user string, busErr *dbus.Error)
//
// ret0:头像路径,为空则表示获取失败
func (m *Manager) RandUserIcon() (iconFile string, busErr *dbus.Error) {
icons := getUserStandardIcons()
if len(icons) == 0 {
if len(_userStandardIcons) == 0 {
return "", dbusutil.ToError(errors.New("Did not find any user icons"))
}

rand.Seed(time.Now().UnixNano())
idx := rand.Intn(len(icons)) // #nosec G404
return icons[idx], nil
idx := rand.Intn(len(_userStandardIcons)) // #nosec G404
return _userStandardIcons[idx], nil
}

func (m *Manager) isDomainUserExist(name string) bool {
Expand Down
92 changes: 78 additions & 14 deletions accounts1/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
)

const (
defaultUserIcon = "file:///var/lib/AccountsService/icons/default.png"
defaultUserBackgroundDir = "/usr/share/wallpapers/deepin/"
defaultUserIcon = "file:///var/lib/AccountsService/icons/default"

controlCenterPath = "/usr/bin/dde-control-center"
deepinDaemonDir = "/usr/lib/deepin-daemon/"
Expand Down Expand Up @@ -73,14 +73,42 @@ const (
defaultWorkspace = 1
)

func getDefaultUserBackground() string {
filename := filepath.Join(defaultUserBackgroundDir, "desktop.bmp")
_, err := os.Stat(filename)
if err == nil {
return "file://" + filename
const (
deepinThemePath = "/usr/share/deepin-themes/"
defaultTheme = "bloom"
themeFile = "index.theme"
themeGroupDefault = "DefaultTheme"
themeGroupDark = "DarkTheme"
configKeyLockBackground = "LockBackground"
)

func getThemeLockBackground(theme string) string {
kf, err := dutils.NewKeyFileFromFile(
path.Join(deepinThemePath, theme, themeFile))
if err != nil {
logger.Warning("load theme failed", err)
return ""
}
defer kf.Free()
bg, err := kf.GetString(themeGroupDefault, configKeyLockBackground)
if err != nil {
logger.Warning("get lock background failed", err)
return ""
}
if !dutils.IsFileExist(bg) {
return ""
}
return bg
}

return "file://" + filepath.Join(defaultUserBackgroundDir, "desktop.jpg")
// 通过默认主题去获取壁纸
func getDefaultUserBackground() string {
bg := "file://" + filepath.Join(defaultUserBackgroundDir, "deepin-default.jpg")
value := getThemeLockBackground(defaultTheme)
if value != "" {
bg = value
}
return bg
}

type User struct {
Expand Down Expand Up @@ -144,6 +172,7 @@ type User struct {

WechatAuthEnabled bool
configLocker sync.Mutex
customIconList []string
}

func NewUser(userPath string, service *dbusutil.Service, ignoreErr bool) (*User, error) {
Expand Down Expand Up @@ -260,11 +289,21 @@ func (u *User) updateIconList() {
_ = u.emitPropChangedIconList(u.IconList)
}

func (u *User) initCustomIcons() {
icons := _userCustomIcons

customIconPre := u.UserName + "-"
for _, icon := range icons {
if strings.Contains(icon, customIconPre) {
u.customIconList = append(u.customIconList, icon)
}
}
}

func (u *User) getAllIcons() []string {
icons := _userStandardIcons
if u.customIcon != "" {
icons = append(icons, u.customIcon)
}

icons = append(icons, u.customIconList...)
return icons
}

Expand All @@ -280,8 +319,9 @@ func (u *User) getGroups() []string {
// ret0: new user icon uri
// ret1: added
// ret2: error
func (u *User) setIconFile(iconURI string) (string, bool, error) {
if isStrInArray(iconURI, u.IconList) {
func (u *User) setIconFile(iconURI string, isNewIcon bool) (string, bool, error) {
// 通过控制中心修改过的自定义用户头像, 需要重新添加进来, 并将之前的头像删除掉, 否则直接返回系统头像
if isStrInArray(iconURI, u.IconList) && !isNewIcon {
return iconURI, false, nil
}

Expand All @@ -303,10 +343,12 @@ func (u *User) setIconFile(iconURI string) (string, bool, error) {
if err != nil {
return "", false, err
}

err = dutils.CopyFile(tmp, dest)
if err != nil {
return "", false, err
}

return dutils.EncodeURI(dest, dutils.SCHEME_FILE), true, nil
}

Expand Down Expand Up @@ -732,10 +774,22 @@ func updateConfigPath(username string) {
}
}

func isOldCustomIcon(u *User) bool {
iconFile := dutils.DecodeURI(u.IconFile)
if _, err := os.Stat(iconFile); os.IsNotExist(err) {
if !isStrInArray(u.IconFile, u.IconList) {
return true
}
}

return false
}

// 从配置文件中加载用户的配置信息
func loadUserConfigInfo(u *User) {
var err error

u.initCustomIcons()
u.IconList = u.getAllIcons()

// NOTICE(jouyouyun): Got created time, not accurate, can only be used as a reference
Expand Down Expand Up @@ -803,12 +857,22 @@ func loadUserConfigInfo(u *User) {
}
icon, _ := kf.GetString(confGroupUser, confKeyIcon)
u.IconFile = icon
if u.IconFile == "" {
// 如果系统升级使用的是原来的头像, 升级后使用当前默认头像
if u.IconFile == "" || isOldCustomIcon(u) {
u.IconFile = defaultUserIcon
isSave = true
}

u.IconList = u.getAllIcons()
u.customIcon, _ = kf.GetString(confGroupUser, confKeyCustomIcon)

// CustomIcon is the newly added field in the configuration file
if u.customIcon == "" {
if u.IconFile != defaultUserIcon && isStrInArray(u.IconFile, u.customIconList) {
// u.IconFile is a custom icon, not a standard icon
u.customIcon = u.IconFile
isSave = true
}
}

_, desktopBgs, _ := kf.GetStringList(confGroupUser, confKeyDesktopBackgrounds)
u.DesktopBackgrounds = desktopBgs
Expand Down
22 changes: 21 additions & 1 deletion accounts1/user_ifc.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,15 @@ func (u *User) SetIconFile(sender dbus.Sender, iconURI string) *dbus.Error {
return dbusutil.ToError(err)
}

// 找到要移除的原始用户头像
var oldIconPath string
for _, icon := range u.customIconList {
if strings.Contains(icon, path.Base(iconURI)) {
oldIconPath = icon
break
}
}

// if iconURI not in iconList, need to create temp icon file
if !isStrInArray(iconURI, u.IconList) {
// copy file to temp file, update icon file
Expand Down Expand Up @@ -489,7 +498,7 @@ func (u *User) SetIconFile(sender dbus.Sender, iconURI string) *dbus.Error {
return nil
}

newIconURI, added, err := u.setIconFile(iconURI)
newIconURI, added, err := u.setIconFile(iconURI, len(oldIconPath) > 0)
if err != nil {
logger.Warning("Set icon failed:", err)
return dbusutil.ToError(err)
Expand All @@ -501,10 +510,20 @@ func (u *User) SetIconFile(sender dbus.Sender, iconURI string) *dbus.Error {
{confKeyCustomIcon, newIconURI},
{confKeyIcon, newIconURI},
})

if err != nil {
return dbusutil.ToError(err)
}

// remove old custom icon
if oldIconPath != "" {
logger.Debugf("remove old custom icon %q", u.customIcon)
err := os.Remove(dutils.DecodeURI(oldIconPath))
if err != nil {
logger.Warning(err)
}
}

// 默认的icon如果不是default.png的情况下,会被设置为customIcon,会被误删,
// 为规避已经设置为customIcon的历史版本,判断如果是icons目录下的数据,就不删除
needRemove := func(uri string) bool {
Expand All @@ -523,6 +542,7 @@ func (u *User) SetIconFile(sender dbus.Sender, iconURI string) *dbus.Error {
}
}
u.customIcon = newIconURI
u.customIconList = append(u.customIconList, newIconURI)
u.updateIconList()
} else {
err = u.writeUserConfigWithChange(confKeyIcon, newIconURI)
Expand Down
Loading

0 comments on commit 6e3a375

Please sign in to comment.