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

Develop/snipe #652

Merged
merged 50 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
a133a46
feat: 支持控制中心个性化头像设置
dengbo11 Mar 30, 2023
358da21
chore: cherry-pick v23 patchs
fly602 Sep 4, 2024
6dc0658
chore: 修复dde-system-daemon崩溃的问题
dengbo11 Apr 7, 2023
d681da6
fix: 登录界面头像显示异常
dengbo11 Apr 17, 2023
21f6a69
feat: 更改默认头像
dengbo11 Apr 19, 2023
d68b689
feat: use dlopen searches library when dpkg-architecture not available
wineee May 5, 2023
3447e12
fix: 登录界面头像显示异常
dengbo11 May 5, 2023
0b484ad
fix: 登录界面头像显示异常
chenchongbiao Aug 4, 2023
6019d64
chore: Makefile can use go mod
dengbo11 May 6, 2023
a921dd3
chore: Sync by https://github.com/linuxdeepin/.github/commit/2e5e092b…
May 10, 2023
9d0dd21
chore: remove unused file
zsien May 9, 2023
b751f65
fix: 第一次进入登陆界面界面缩放异常
dengbo11 May 11, 2023
6849716
chore: update tx config
dengbo11 May 23, 2023
e3a0b6d
chore(CI): Update obs tag build workflow
hudeng-go May 19, 2023
ac1cf32
feat: 添加鼠标和触摸板开关接口
dengbo11 Jun 2, 2023
2edec47
feat: 添加鼠标和触摸板使能属性
dengbo11 Jun 2, 2023
1406f8f
Revert "chore: Makefile can use go mod"
fly602 Sep 4, 2024
a536ba0
feat: search in XDG directories
fly602 Sep 4, 2024
485287e
chore: add gen.go
Decodetalkers Apr 7, 2023
c6520a9
feat: add locale region set
dengbo11 Jul 4, 2023
963218a
chore: Sync by https://github.com/linuxdeepin/.github/commit/559e9116…
Jul 10, 2023
e743b46
fix: fix daemon packaging error
dengbo11 Jul 14, 2023
18a22e8
feat: support to use pipewire
dengbo11 Jul 18, 2023
a6aad87
feat: don't need retry 5 count to start audio server
dengbo11 Jul 18, 2023
f6c35b6
feat: add bluetooth battery
kt286 Jul 25, 2023
e7abc9a
feat: update battery when org.bluez.Battery1 interface added or removed
kt286 Jul 31, 2023
8076728
fix: launch incorrect pipewire service
dengbo11 Aug 17, 2023
8a37054
feat: search in XDG directories
fly602 Sep 4, 2024
6184c1f
fix: tpad enable status misjudgment
dengbo11 Sep 5, 2023
1050911
fix: touchpad enable status misjudgment
dengbo11 Sep 11, 2023
375d165
fix: dock bluetooth module is missing
dengbo11 Sep 14, 2023
31a1c27
feat: add pause player interface
Decodetalkers Oct 9, 2023
4108809
fix: bash is not default SHELL for new user
hotime Oct 20, 2023
8db8a21
chore: correct typos in system/network/ping.go
felixonmars Sep 30, 2023
6351c78
feat: add audio server switch support
chenchongbiao Nov 2, 2023
ecfafbd
feat: update icon name
chenchongbiao Nov 13, 2023
b21d692
fix: wifi device not enable
dengbo11 Nov 21, 2023
2a39482
fix: accounts icon save error
dengbo11 Dec 27, 2023
67ef796
fix: remove locale region set
dengbo11 Dec 28, 2023
2f8c9cf
feat: search in XDG directories
Decodetalkers Dec 27, 2023
efaa2b1
fix: invalid timezone during set dateTime
Decodetalkers Jan 16, 2024
71b4803
fix: set the default value of statusNotifierHost to true
ComixHe Jan 19, 2024
cdfac67
fix: fix a crash
zsien Apr 29, 2024
b9ba74f
fix: the dock icon of deepin-terminal quake mode is missing
fly602 Sep 4, 2024
3afa1a4
fix: archlinux build error
hudeng-go Apr 18, 2024
be3f910
fix: pressing the power button opened the lock screen
zsien Jun 20, 2024
e591f44
feat: TreeLand display service special handlle
Aug 8, 2024
5ba7558
chore: 修改默认greeter壁纸 (#645)
fly602 Aug 9, 2024
912b45e
fix: unable to start under wayland
justforlxz Aug 16, 2024
5de6133
chore: 修改polikit中actiond的风格
fly602 Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Loading