Skip to content

WM-241: remove activate_session/deactivate_session requests - #85

Open
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/developer/aed55fc8
Open

WM-241: remove activate_session/deactivate_session requests#85
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/developer/aed55fc8

Conversation

@deepin-wm

@deepin-wm deepin-wm commented Aug 11, 2026

Copy link
Copy Markdown

Related to WM-241

Drop the activate_session / deactivate_session requests from
xml/treeland-ddm-v1.xml. VT switching is now handled natively by
wlroots/libseat (dde-seatd), ddm never sends these requests, and the
treeland handlers that implemented them have been removed in the
companion treeland PR, so these dead protocol requests are no longer
needed.

This is a private treeland<->ddm protocol; removing unused requests is
safe. No version bump is required — removing requests does not break
clients (and no client sends them). ddm does not reference these
requests and builds against either the old or new protocol.

Summary by Sourcery

Remove unused treeland-ddm protocol requests related to session activation and deactivation, relying on native VT switching instead.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @deepin-wm, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@sourcery-ai

sourcery-ai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the private treeland<->ddm protocol definition by removing two now-unused session control requests from the XML protocol file, relying instead on native VT handling in wlroots/libseat.

Sequence diagram for removed treeland_ddm session control requests

sequenceDiagram
    participant ddm
    participant treeland

    ddm->>treeland: activate_session
    ddm->>treeland: deactivate_session
Loading

File-Level Changes

Change Details Files
Remove obsolete session activation/deactivation requests from the treeland-ddm protocol XML.
  • Delete the activate_session request definition and its description block from the protocol XML.
  • Delete the deactivate_session request definition and its description block from the protocol XML, leaving surrounding requests (e.g., enable_render) unchanged.
xml/treeland-ddm-v1.xml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

VT switching is now handled natively by wlroots/libseat (dde-seatd).
ddm never sends activate_session/deactivate_session requests, and the
treeland handlers that implemented them have been removed, so these
dead protocol requests are dropped from treeland-ddm-v1.xml.

Verified in ddm: TreelandConnector.cpp only calls
treeland_ddm_v1_switch_to_greeter/switch_to_user; 0 references to
activate_session/deactivate_session in ddm source.

Related: WM-241
@deepin-wm
deepin-wm force-pushed the agent/developer/aed55fc8 branch from ec2d85d to 1a466e5 Compare August 12, 2026 03:34
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-wm

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码通过移除Wayland协议中的冗余接口实现了接口清理与废弃操作
逻辑正确且符合XML规范,因无安全漏洞且提升代码整洁度给予95分

■ 【详细分析】

  • 1.语法逻辑完全正确✓

在文件 xml/treeland-ddm-v1.xml 中,移除了 activate_session 和 deactivate_session 两个 request 节点,XML 标签闭合正确,未破坏文档结构。
潜在问题:无
建议:无需修改

  • 2.代码质量良好✓

移除不再使用的接口定义,有助于减少协议的复杂度和维护成本,保持协议文件的精简。
潜在问题:无
建议:建议同步检查 C++ 后端实现代码中对应的 TreelandDdm::activate_session() 和 TreelandDdm::deactivate_session() 方法是否已一并删除,避免残留死代码。

  • 3.代码性能无性能问题✓

协议文件的精简不会对运行时性能产生负面影响,反而可能略微减少协议解析时的开销。
潜在问题:无
建议:无需修改

  • 4.代码安全存在0个安全漏洞✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次变更仅涉及删除冗余的 Wayland 协议接口定义,未引入任何外部输入处理或危险操作,无安全风险。

  • 建议:无需安全修复

■ 【改进建议代码示例】

diff --git a/xml/treeland-ddm-v1.xml b/xml/treeland-ddm-v1.xml
index 6fd1154..1a3fd60 100644
--- a/xml/treeland-ddm-v1.xml
+++ b/xml/treeland-ddm-v1.xml
@@ -22,18 +22,6 @@
             </description>
             <arg name="username" type="string"/>
         </request>
-        <request name="activate_session">
-            <description summary="activate wayland session">
-                Activate treeland session. This will makes treeland try to take
-                control of screen.
-            </description>
-        </request>
-        <request name="deactivate_session">
-            <description summary="deactivate wayland session">
-                Deactivate treeland session. This will release control of the
-                screen, but not to close the current seats.
-            </description>
-        </request>
         <request name="enable_render">
             <description summary="start treeland rendering">
                 Enable treeland rendering. This is primarily called after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants