Skip to content

feat: add normal role to dde-shell surface role enum - #119

Merged
Groveer merged 1 commit into
linuxdeepin:masterfrom
wineee:dde-shell
Sep 30, 2026
Merged

Groveer merged 1 commit into
linuxdeepin:masterfrom
wineee:dde-shell

Conversation

@wineee

@wineee wineee commented Sep 30, 2026 •

Copy link
Copy Markdown
Member
  1. Add normal (0) to the treeland_dde_shell_surface_v2 role enum and keep overlay at 1 so a shell surface can be restored from the overlay layer back to the normal window layer.
  2. Document that set_role(normal) returns the surface to regular toplevel stacking while overlay remains the default.
  3. Sync the protocol purpose and v1-to-v2 migration notes in the dde/ and public/ READMEs (EN + zh_CN).

Log: DDE shell surfaces can now restore to normal window layer.

Influence:

  1. Run ./check-protocol-xml.sh dde/treeland-dde-shell-unstable-v2.xml and confirm wayland-scanner exits clean.
  2. Verify the generated header exposes ROLE_NORMAL=0 and ROLE_OVERLAY=1.
  3. In a client, call set_role(overlay) then set_role(normal) and check the surface returns to regular toplevel stacking.

feat: 为 dde-shell surface role 枚举新增 normal 角色

  1. 在 treeland_dde_shell_surface_v2 的 role 枚举中新增 normal(0), overlay 保持为 1,使 shell surface 可从 overlay 层还原回普通窗口层。
  2. 补充说明 set_role(normal) 会恢复常规 toplevel 叠放,overlay 仍为默认值。
  3. 同步 dde/ 与 public/ 下中英文 README 的协议用途及 v1→v2 迁移说明。

Log: DDE shell surface 现可还原至普通窗口层。

Influence:

  1. 运行 ./check-protocol-xml.sh dde/treeland-dde-shell-unstable-v2.xml 并确认 wayland-scanner 退出码为 0。
  2. 检查生成的头文件中 ROLE_NORMAL=0、ROLE_OVERLAY=1。
  3. 客户端依次调用 set_role(overlay) 与 set_role(normal),确认 surface 恢复到常规 toplevel 叠放。

Summary by Sourcery

Allow DDE shell surfaces to switch between the workspace overlay layer and the regular window layer.

New Features:

  • Add a normal shell-surface role that restores regular toplevel stacking while preserving overlay as role value 1 and the default.

Enhancements:

  • Clarify DDE shell surface layer semantics and role behavior in the protocol documentation.

Documentation:

  • Update English and Chinese DDE and public README documentation to describe the normal and overlay roles and correct v1-to-v2 migration guidance.

1. Add normal (0) to the treeland_dde_shell_surface_v2 role enum and
   keep overlay at 1 so a shell surface can be restored from the
   overlay layer back to the normal window layer.
2. Document that set_role(normal) returns the surface to regular
   toplevel stacking while overlay remains the default.
3. Sync the protocol purpose and v1-to-v2 migration notes in the dde/
   and public/ READMEs (EN + zh_CN).

Log: DDE shell surfaces can now restore to normal window layer.

Influence:
1. Run ./check-protocol-xml.sh dde/treeland-dde-shell-unstable-v2.xml
   and confirm wayland-scanner exits clean.
2. Verify the generated header exposes ROLE_NORMAL=0 and ROLE_OVERLAY=1.
3. In a client, call set_role(overlay) then set_role(normal) and check
   the surface returns to regular toplevel stacking.

feat: 为 dde-shell surface role 枚举新增 normal 角色

1. 在 treeland_dde_shell_surface_v2 的 role 枚举中新增 normal(0),
   overlay 保持为 1,使 shell surface 可从 overlay 层还原回普通窗口层。
2. 补充说明 set_role(normal) 会恢复常规 toplevel 叠放,overlay 仍为默认值。
3. 同步 dde/ 与 public/ 下中英文 README 的协议用途及 v1→v2 迁移说明。

Log: DDE shell surface 现可还原至普通窗口层。

Influence:
1. 运行 ./check-protocol-xml.sh dde/treeland-dde-shell-unstable-v2.xml
   并确认 wayland-scanner 退出码为 0。
2. 检查生成的头文件中 ROLE_NORMAL=0、ROLE_OVERLAY=1。
3. 客户端依次调用 set_role(overlay) 与 set_role(normal),确认 surface
   恢复到常规 toplevel 叠放。
@sourcery-ai

sourcery-ai Bot commented Sep 30, 2026

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

Reviewer's Guide

The protocol now supports switching DDE shell surfaces between the default workspace overlay layer and the normal window layer, with XML semantics and English/Chinese migration documentation synchronized to the new normal=0 and overlay=1 enum values.

Sequence diagram for restoring a DDE shell surface to the normal window layer

sequenceDiagram
    participant Client
    participant Surface as treeland_dde_shell_surface_v2
    participant Compositor
    Client->>Surface: set_role(overlay)
    Surface->>Compositor: Render at workspace overlay layer
    Client->>Surface: set_role(normal)
    Surface->>Compositor: Render at normal window layer
    Compositor-->>Surface: Participate in regular toplevel stacking
Loading

Flow diagram for DDE shell surface role layers

flowchart LR
    Default["Default role: overlay = 1"] --> Overlay["Workspace overlay layer\nAbove normal toplevels\nBelow layer-shell surfaces"]
    Overlay -->|"set_role(normal)"| Normal["normal = 0\nRegular window layer\nNormal toplevel stacking"]
    Normal -->|"set_role(overlay)"| Overlay
Loading

File-Level Changes

Change Details Files
Extends the v2 shell-surface role model to support restoring surfaces to regular toplevel stacking while preserving overlay compatibility.
  • Adds role enum value normal=0 and keeps overlay=1.
  • Documents overlay as the default and normal as the regular window-layer behavior when selected via set_role.
  • Updates protocol descriptions and migration guidance to reflect the stable role values and semantics.
dde/treeland-dde-shell-unstable-v2.xml
dde/README.md
dde/README.zh_CN.md
public/README.md
public/README.zh_CN.md

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

@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.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="dde/treeland-dde-shell-unstable-v2.xml" line_range="106-107" />
<code_context>
                 ordering within a single role is undefined.
             </description>
-            <entry name="overlay" value="0" summary="workspace overlay layer, above normal toplevels and below layer-shell surfaces" />
+            <entry name="normal" value="0" summary="normal window layer, below the overlay layer and participating in regular toplevel stacking" />
+            <entry name="overlay" value="1" summary="workspace overlay layer, above normal toplevels and below layer-shell surfaces" />
         </enum>

</code_context>
<issue_to_address>
**issue (broader_impact):** The v2 wire value for `overlay` changes from 0 to 1 while both interfaces remain version 1, so existing v2 clients compiled against the previous XML and explicitly calling `set_role(overlay)` send 0 and are interpreted as requesting `normal`, silently moving the surface into regular toplevel stacking.

**Triggers:** When an already-deployed v2 client explicitly sets the overlay role using the previous generated header or a literal value of 0.

**Suggested fix:** Preserve the existing v2 `overlay=0` value and assign the new `normal` role to 1, or introduce a versioned protocol/interface that allows clients to distinguish the changed enum mapping.

```suggestion
            <entry name="normal" value="1" summary="normal window layer, below the overlay layer and participating in regular toplevel stacking" />
            <entry name="overlay" value="0" summary="workspace overlay layer, above normal toplevels and below layer-shell surfaces" />
```
</issue_to_address>

### Comment 2
<location path="dde/treeland-dde-shell-unstable-v2.xml" line_range="74-77" />
<code_context>
-            wl_surface. A shell surface renders below the wlr-layer-shell
-            layer stack, at the overlay level of the workspace: above
-            normal toplevel windows but below layer-shell surfaces.
+            wl_surface. A shell surface renders either at the overlay level
+            of the workspace (above normal toplevel windows but below
+            layer-shell surfaces) or at the normal window layer, as
+            selected by the set_role request. The default role is overlay.

             The role carries no requests that map, commit, or configure
</code_context>
<issue_to_address>
**issue:** The protocol-level description at the top of the XML still says every shell surface renders below the layer-shell stack at the workspace overlay level, so the generated protocol documentation contradicts the changed interface description that permits the `normal` window layer and does not document the new behavior in the protocol purpose.

**Triggers:** When consumers or maintainers rely on the protocol-level description rather than the interface-specific description.

**Suggested fix:** Update the top-level protocol description to state that a shell surface can render either at the overlay level or at the normal window layer, with overlay as the default.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines +106 to +107
<entry name="normal" value="0" summary="normal window layer, below the overlay layer and participating in regular toplevel stacking" />
<entry name="overlay" value="1" summary="workspace overlay layer, above normal toplevels and below layer-shell surfaces" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (broader_impact): The v2 wire value for overlay changes from 0 to 1 while both interfaces remain version 1, so existing v2 clients compiled against the previous XML and explicitly calling set_role(overlay) send 0 and are interpreted as requesting normal, silently moving the surface into regular toplevel stacking.

Triggers: When an already-deployed v2 client explicitly sets the overlay role using the previous generated header or a literal value of 0.

Suggested fix: Preserve the existing v2 overlay=0 value and assign the new normal role to 1, or introduce a versioned protocol/interface that allows clients to distinguish the changed enum mapping.

Suggested change
<entry name="normal" value="0" summary="normal window layer, below the overlay layer and participating in regular toplevel stacking" />
<entry name="overlay" value="1" summary="workspace overlay layer, above normal toplevels and below layer-shell surfaces" />
<entry name="normal" value="1" summary="normal window layer, below the overlay layer and participating in regular toplevel stacking" />
<entry name="overlay" value="0" summary="workspace overlay layer, above normal toplevels and below layer-shell surfaces" />

Comment on lines +74 to +77
wl_surface. A shell surface renders either at the overlay level
of the workspace (above normal toplevel windows but below
layer-shell surfaces) or at the normal window layer, as
selected by the set_role request. The default role is overlay.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue: The protocol-level description at the top of the XML still says every shell surface renders below the layer-shell stack at the workspace overlay level, so the generated protocol documentation contradicts the changed interface description that permits the normal window layer and does not document the new behavior in the protocol purpose.

Triggers: When consumers or maintainers rely on the protocol-level description rather than the interface-specific description.

Suggested fix: Update the top-level protocol description to state that a shell surface can render either at the overlay level or at the normal window layer, with overlay as the default.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Groveer, wineee

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

@Groveer
Groveer added this pull request to the merge queue Sep 30, 2026
Merged via the queue into linuxdeepin:master with commit 47817c2 Sep 30, 2026
5 checks passed
@wineee
wineee deleted the dde-shell branch September 30, 2026 06:24
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