Skip to content

feat: implement xdg-dialog-v1 protocol#1009

Open
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/xdg-dialog-v1
Open

feat: implement xdg-dialog-v1 protocol#1009
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/xdg-dialog-v1

Conversation

@deepin-wm

Copy link
Copy Markdown
Contributor

Summary

Implement the xdg-dialog-v1 Wayland protocol, which allows clients to declare whether a window is a dialog (modal or modeless).

Changes

  • New module: src/modules/xdg-dialog/ — implements xdg_wm_dialog_v1 and xdg_dialog_v1 interfaces
  • Helper: registers the protocol and connects surfaceModalChanged signal to WXdgToplevelSurface::setModal
  • WXdgToplevelSurface: adds modal property with signal
  • SurfaceWrapper: adds modal QML property with binding
  • Logging: adds lcTlXdgDialog category

Signal Chain

XdgDialogV1Resource::set_modal/set_modeless
  → XdgDialogManagerInterfaceV1Private::emitModalChanged
    → XdgDialogManagerInterfaceV1::surfaceModalChanged
      → Helper lambda → WXdgToplevelSurface::setModal
        → SurfaceWrapper::setModal

Protocol Error Handling

  • Non-toplevel xdg_surfaceerror_already_used
  • Duplicate get_xdg_dialog on same surface → error_already_used

Fixes: #WM-27

@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

@deepin-wm deepin-wm force-pushed the feat/xdg-dialog-v1 branch 3 times, most recently from db5a9b6 to ee32217 Compare June 18, 2026 08:32
Comment thread src/common/treelandlogging.cpp Outdated
Q_LOGGING_CATEGORY(lcTlDdm, "treeland.ddm")

// XdgDialog module
Q_LOGGING_CATEGORY(lcTlXdgDialog, "treeland.xdg-dialog")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

某协议相关的日志请用 treeland.protocol.xxxx 这样的结构,其它不符合要求的请用一个新pr修改,你新增的这个就直接改了。


QString tag;
QString description;
uint modal:1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

不应该是加到 fullscreen 后面吗?

@deepin-wm deepin-wm force-pushed the feat/xdg-dialog-v1 branch 7 times, most recently from 8d34244 to 898316b Compare June 18, 2026 12:04
@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

4 similar comments
@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

[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

[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

[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

1. Add xdg-dialog module implementing xdg_wm_dialog_v1 and
   xdg_dialog_v1 interfaces
2. Handle set_modal/unset_modal requests and emit
   surfaceModalChanged signal through full chain
3. Add lcTlXdgDialog logging category
   (treeland.protocol.xdg-dialog)
4. Register protocol in Helper, connect modal state
   to WXdgToplevelSurface
5. Add modal property to WXdgToplevelSurface in waylib
   and SurfaceWrapper with QML binding
6. Add unit test for protocol registration and signals

Log: Added xdg-dialog-v1 protocol support for dialog
window identification and modal state management

Influence:
1. Verify xdg-dialog-v1 protocol works with dialog clients
2. Test modal dialog state propagation through surface stack
3. Verify duplicate xdg_toplevel triggers error_already_used
4. Test set_modal/unset_modal state transitions

feat: 实现 xdg-dialog-v1 协议

1. 新增 xdg-dialog 模块,实现 xdg_wm_dialog_v1 和
   xdg_dialog_v1 接口
2. 处理 set_modal/unset_modal 请求,通过完整信号链
   发送 surfaceModalChanged 信号
3. 新增 lcTlXdgDialog 日志分类
   (treeland.protocol.xdg-dialog)
4. 在 Helper 中注册协议并连接 modal 状态到
   WXdgToplevelSurface
5. 在 WXdgToplevelSurface 和 SurfaceWrapper 中
   添加 modal 属性及 QML 绑定
6. 添加协议注册和信号的单元测试

Log: 新增 xdg-dialog-v1 协议支持对话框窗口识别与
模态状态管理

Influence:
1. 验证 xdg-dialog-v1 协议与对话框客户端的交互
2. 测试模态对话框状态在 surface 栈中的传播
3. 验证重复 xdg_toplevel 触发 error_already_used
4. 测试 set_modal/unset_modal 状态切换
@deepin-wm deepin-wm force-pushed the feat/xdg-dialog-v1 branch from 898316b to 80181e0 Compare June 18, 2026 13: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