Skip to content

Implement xdg-dialog-v1 Wayland protocol#4790

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/implement-xdg-dialog
Draft

Implement xdg-dialog-v1 Wayland protocol#4790
Copilot wants to merge 2 commits intomainfrom
copilot/implement-xdg-dialog

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

Implements the xdg-dialog-v1 staging Wayland protocol, which maps cleanly onto Mir's mir_window_type_dialog window management type.

What's new?

  • wayland-protocols/xdg-dialog-v1.xml — Protocol definition: xdg_wm_dialog_v1 global manager and xdg_dialog_v1 per-toplevel object with set_modal/unset_modal requests
  • src/server/frontend_wayland/xdg_dialog_v1.{h,cpp} — Implementation:
    • get_xdg_dialog sets the associated toplevel's type to mir_window_type_dialog
    • Tracks per-manager toplevel→dialog associations (raises already_used on duplicate)
    • set_modal/unset_modal are intentional no-ops — mir_window_type_dialog already encapsulates modal dialog semantics in Mir
    • Lifetime safety via shared_ptr<ToplevelsWithDialogs> captured in destroy listeners, matching the pattern in xdg_decoration_unstable_v1
  • src/wayland/CMakeLists.txt — Adds wrapper code generation for the new XML
  • src/server/frontend_wayland/CMakeLists.txt — Adds new source files
  • wayland_default_configuration.cpp — Registers xdg_wm_dialog_v1 as a standard (default-enabled) extension

How to test

Build Mir and run a Wayland client that uses xdg_wm_dialog_v1 (e.g. GTK4 apps use this protocol). Verify the window is treated as a dialog by the window manager.

Alternatively, use wayland-info to confirm xdg_wm_dialog_v1 is advertised as a global.

Checklist

  • Tests added and pass
  • Adequate documentation added
  • (optional) Added Screenshots or videos

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • gitlab.freedesktop.org
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement xdg-dialog</issue_title>
<issue_description>### Summary

The Wayland xdg-dialog protocol appears to match well with our window management types. We should implement it

Details

No response

Prior Art

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: AlanGriffiths <9048879+AlanGriffiths@users.noreply.github.com>
Agent-Logs-Url: https://github.com/canonical/mir/sessions/57869bba-f1af-4bf3-b578-8b9ba38da6fa
Copilot AI changed the title [WIP] Implement xdg-dialog protocol for window management Implement xdg-dialog-v1 Wayland protocol Mar 23, 2026
Copilot AI requested a review from AlanGriffiths March 23, 2026 15:48
@github-actions
Copy link

TICS Quality Gate

✔️ Passed

mir

Coding Standards: ✔️ Passed

✔️ Condition “No new Coding Standard Violations for level 1, 2, 3 with respect to Previous analysis” passed.

See the results in the TICS Viewer

The following files have been checked for this project
  • src/server/frontend_wayland/wayland_default_configuration.cpp
  • src/server/frontend_wayland/xdg_dialog_v1.cpp
  • src/server/frontend_wayland/xdg_dialog_v1.h

TICS / TICS / Run TICS analysis

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements the staging xdg-dialog-v1 Wayland protocol in Mir’s Wayland frontend, mapping xdg_dialog_v1 to Mir’s mir_window_type_dialog so toolkits (e.g. GTK4) can reliably mark toplevels as dialogs.

Changes:

  • Added the xdg-dialog-v1 protocol XML and hooked it into Mir’s protocol-wrapper generation.
  • Implemented xdg_wm_dialog_v1 / xdg_dialog_v1 handling in the Wayland frontend, setting the toplevel window type to mir_window_type_dialog and enforcing one dialog object per toplevel (per manager).
  • Enabled the new global by default via Wayland’s default extension configuration and build system wiring.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
wayland-protocols/xdg-dialog-v1.xml Adds the upstream protocol definition for xdg_wm_dialog_v1 and xdg_dialog_v1.
src/wayland/CMakeLists.txt Generates Mir Wayland wrappers for xdg-dialog-v1.xml.
src/server/frontend_wayland/xdg_dialog_v1.h Declares the extension factory for xdg_wm_dialog_v1.
src/server/frontend_wayland/xdg_dialog_v1.cpp Implements the protocol objects and maps dialogs to mir_window_type_dialog.
src/server/frontend_wayland/CMakeLists.txt Adds the new implementation files to the Wayland frontend build.
src/server/frontend_wayland/wayland_default_configuration.cpp Registers xdg_wm_dialog_v1 and includes it in the standard extension set.

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.

Implement xdg-dialog

3 participants