Draft
Conversation
Implements the zxdg_exporter_v2 and zxdg_importer_v2 Wayland protocols which allow cross-client surface parent-child relationships. This fixes GTK apps warning 'Server is missing xdg_foreign support'. Agent-Logs-Url: https://github.com/canonical/mir/sessions/f077889f-0f3f-4fdc-ab26-c1ae4d2eb835 Co-authored-by: AlanGriffiths <9048879+AlanGriffiths@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Support xdg foreign in Purple Task app
Support xdg-foreign-unstable-v2 protocol
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GTK apps (e.g. Purple Task) warn "Server is missing xdg_foreign support" because Mir lacks
zxdg_exporter_v2/zxdg_importer_v2. This breaks cross-process surface parent-child relationships, making buttons like "View source code" and "Report issues" in sandboxed Flutter apps non-functional.What's new?
wayland-protocols/xdg-foreign-unstable-v2.xml— protocol definition forzxdg_exporter_v2,zxdg_importer_v2,zxdg_exported_v2,zxdg_imported_v2src/server/frontend_wayland/xdg_foreign_unstable_v2.{h,cpp}— implementation:XdgForeignV2Registry: shared registry mapping opaque handle strings to exportedWlSurfaceweak refs, with per-handle importer tracking fordestroyedevent deliveryZxdgExportedV2generates a random 128-bit hex handle, sends it via thehandleeventZxdgImportedV2::set_parent_of()resolves the handle to a scene surface and sets it as the parent viaWlSurface::update_surface_spec(); defers viaon_scene_surface_createdif the exported surface has no scene surface yetZxdgExportedV2destruction (explicit or surface-driven) drains the importer list and sendsdestroyedto eachwayland_default_configuration.cpp— registers the combined exporter+importer global undermw::XdgExporterV2::interface_name; both Wayland globals are created in one callzxdg_exporter_v2added toget_standard_extensions()— enabled by defaultsrc/wayland/symbols.map— exports all four new wrapper classes underMIRWAYLAND_2.17How to test
Run a GTK4 application (e.g. any app using
GtkFileChooserNativeorGtkPrintDialog) under a Mir-based compositor and verify the "Server is missing xdg_foreign support" warning no longer appears. Cross-process dialogs (portals) should now correctly set the parent window relationship.Checklist
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:
dl.google.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https --local /home/REDACTED/.ca/var/lib/dpkg/reassemble.deb tar -x _amd64.deb - /usr/bin/dpkg-deb 2.1ubuntu3.2_amdrm d64.deb /usr/local/sbin/--(dns block)gitlab.freedesktop.org/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: