Skip to content

Commit 28abc12

Browse files
committed
fix: initialize GDK in accounts module and remove GTK init
1. Added GDK initialization in accounts module to ensure proper image handling functionality 2. Removed GTK initialization from session daemon main function to reduce unnecessary dependencies 3. Updated CGO pkg-config to remove gtk+-3.0 dependency from session daemon 4. Added error handling for GDK initialization failure with warning log Log: Fixed potential image processing issues in user account management Influence: 1. Test user account avatar loading and display 2. Verify user account creation and management functionality 3. Test session startup without GTK dependency 4. Check for any image-related errors in system logs 5. Verify backward compatibility with existing user accounts 6. Test system performance impact after removing GTK initialization fix: 在账户模块中初始化GDK并移除GTK初始化 1. 在账户模块中添加GDK初始化以确保正确的图像处理功能 2. 从会话守护进程主函数中移除GTK初始化以减少不必要的依赖 3. 更新CGO pkg-config配置,从会话守护进程中移除gtk+-3.0依赖 4. 添加GDK初始化失败的错误处理并记录警告日志 Log: 修复了用户账户管理中潜在的图像处理问题 Influence: 1. 测试用户账户头像加载和显示功能 2. 验证用户账户创建和管理功能 3. 测试无GTK依赖的会话启动 4. 检查系统日志中是否有图像相关的错误 5. 验证与现有用户账户的向后兼容性 6. 测试移除GTK初始化后的系统性能影响 PMS: BUG-316783
1 parent 0cd3127 commit 28abc12

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

accounts1/accounts.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package accounts
77
import (
88
"github.com/linuxdeepin/dde-daemon/accounts1/logined"
99
"github.com/linuxdeepin/dde-daemon/loader"
10+
"github.com/linuxdeepin/go-lib/gdkpixbuf"
1011
"github.com/linuxdeepin/go-lib/log"
1112
)
1213

@@ -23,6 +24,10 @@ func getAccountsManager() *Manager {
2324
}
2425

2526
func init() {
27+
err := gdkpixbuf.InitGdk()
28+
if err != nil {
29+
logger.Warning("Failed to initialize GDK:", err)
30+
}
2631
loader.Register(NewDaemon())
2732
}
2833

bin/dde-session-daemon/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
package main
66

7-
//#cgo pkg-config: x11 gtk+-3.0
7+
//#cgo pkg-config: x11
88
//#cgo CFLAGS: -W -Wall -fstack-protector-all -fPIC
99
//#include <X11/Xlib.h>
10-
//#include <gtk/gtk.h>
11-
//void init(){XInitThreads();gtk_init(0,0);}
10+
//void init(){XInitThreads();}
1211
import "C"
1312
import (
1413
"bufio"

0 commit comments

Comments
 (0)