Commit 22b7784
fix: add X connection monitoring for session logout
Added XCB dependency and implemented X server connection monitoring to
detect when the X server disconnects. This ensures the session properly
logs out when the X server connection is lost, preventing orphaned
sessions.
1. Added libxcb1-dev to Build-Depends in debian/control
2. Added XCB pkg-config check and linking in CMakeLists.txt
3. Implemented watchXConnection() method that establishes an XCB
connection and monitors the file descriptor using QSocketNotifier
4. When X connection errors are detected, the session automatically
triggers logout to clean up resources
5. Only activates on X11 displays, not Wayland
This fix addresses cases where X server crashes or disconnects
unexpectedly, leaving the session manager running without a display
server.
fix: 添加X连接监控以实现会话登出
添加XCB依赖并实现X服务器连接监控,以检测X服务器断开连接的情况。这确保当X
服务器连接丢失时会话能正确登出,防止出现孤儿会话。
1. 在debian/control的Build-Depends中添加libxcb1-dev
2. 在CMakeLists.txt中添加XCB pkg-config检查和链接
3. 实现watchXConnection()方法,使用XCB建立连接并通过QSocketNotifier监控
文件描述符
4. 当检测到X连接错误时,会话自动触发登出以清理资源
5. 仅在X11显示环境下激活,Wayland环境下不启用
此修复解决了X服务器崩溃或意外断开连接时,会话管理器在没有显示服务器的情
况下继续运行的问题。
PMS: BUG-3534611 parent 6dd2af9 commit 22b7784
4 files changed
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
541 | 543 | | |
542 | 544 | | |
543 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
544 | 550 | | |
545 | 551 | | |
546 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
547 | 580 | | |
548 | 581 | | |
549 | 582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
0 commit comments