feat: Support TTY switching with DDM#489
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: apr3vau The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @apr3vau. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's GuideRefactor TTY switching to use Deepin Display Manager (DDM) via D-Bus, introduce a WBackend onCreated hook for immediate VT control, implement DDM-driven VT transitions on Ctrl+Alt+Fx with session activation/deactivation signaling, and expose session activation over D-Bus. Sequence diagram for VT switching with DDM on Ctrl+Alt+FxsequenceDiagram
actor User
participant Helper
participant DDM as "DDM (D-Bus)"
participant Backend
User->>Helper: Press Ctrl+Alt+Fx
Helper->>DDM: Call VTUser(vtnr)
DDM-->>Helper: Return user (may be empty)
alt user is empty
Helper->>DDM: Call SwitchToVT(vtnr)
Helper->>Helper: deactivateSession()
else user is not empty
alt user != "ddm"
Helper->>Helper: m_userModel->setCurrentUserName(user)
end
Helper->>DDM: Call SwitchToVT(vtnr)
end
Sequence diagram for WBackend creation and VT acquisitionsequenceDiagram
participant Server
participant Backend as WBackend
participant Helper
participant DDM as "DDM (D-Bus)"
Server->>Backend: create()
Backend-->>Helper: onCreated signal
Helper->>DDM: AcquireVT(0)
ER diagram for D-Bus interface changes (org.deepin.compositor1)erDiagram
COMPOSITOR1 {
string XWaylandName
void ActivateSession
}
Updated class diagram for Helper and WBackendclassDiagram
class Helper {
+void activateSession()
+void deactivateSession()
}
class WBackend {
+void onCreated()
}
Helper o-- WBackend : m_backend
WBackend --|> QObject
WBackend --|> WObject
WBackend --|> WServerObject
Updated class diagram for TreelandclassDiagram
class Treeland {
+void ActivateSession()
}
Treeland o-- Helper : d->helper
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @apr3vau - I've reviewed your changes - here's some feedback:
- Extract the DDM D-Bus interaction (creating QDBusInterface and calling VT methods) into a shared helper to avoid duplicating inline calls and make future maintenance easier.
- Add explicit error checking on QDBusReply (e.g. isValid()/error()) so that D-Bus failures when acquiring or switching VTs are handled rather than ignored.
- Standardize your naming (e.g. ActivateSession vs activateSession, onCreated vs created) to match the rest of the codebase’s signal/slot conventions for consistency.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Extract the DDM D-Bus interaction (creating QDBusInterface and calling VT methods) into a shared helper to avoid duplicating inline calls and make future maintenance easier.
- Add explicit error checking on QDBusReply (e.g. isValid()/error()) so that D-Bus failures when acquiring or switching VTs are handled rather than ignored.
- Standardize your naming (e.g. ActivateSession vs activateSession, onCreated vs created) to match the rest of the codebase’s signal/slot conventions for consistency.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
ddm PR 快速链接 linuxdeepin/ddm#34 |
8d34bd1 to
c511bd2
Compare
e014a85 to
115014d
Compare
1. Remove dependence of seatd-dde.service, use system provided seatd service; 2. Add private wayland protocol treeland-private-protocol.xml for IPC 3. Acquire VT control immediately after first rendering complete; 4. Call DDM to switch VT when Ctrl+Alt+Fx is pressed, if available; 5. Expose wayland request for deactivate and re-activate session to DDM;
…uck for switching too quickly Treeland will failed to deactivate session when the animation is still playing, and get the whole VT stuck. Disable all animation to prevent it as mostly as possible.
#417
Summary by Sourcery
Enable TTY switching through the Deepin Display Manager by acquiring VT control at startup, handling Ctrl+Alt+Fx switches via DDM, and adding a D-Bus interface for session reactivation.
New Features:
Enhancements:
Chores: