Skip to content

feat: add gtk and kde appmenu protocols#833

Open
81reap wants to merge 1 commit intomangowm:mainfrom
81reap:main
Open

feat: add gtk and kde appmenu protocols#833
81reap wants to merge 1 commit intomangowm:mainfrom
81reap:main

Conversation

@81reap
Copy link
Copy Markdown

@81reap 81reap commented Apr 7, 2026

First step toward issue #832 (global application menus on Wayland). This PR adds two Wayland protocol XMLs into protocols/ and wires them into the meson build. My plan is to raise follow up PRs to build on top of this :

  1. (this PR) Add the two protocol XMLs.
  2. Implement org_kde_kwin_appmenu server-side: store per-Client state, register the global.
  3. Implement the trimmed gtk_shell1 server-side. Same shape.
  4. Bump dwl-ipc-unstable-v2 to interface version 3, add a single new appmenu event carrying both protocols' fields, expose them via mmsg -M, with backwards-compatible versions so old panels keep working.

Files in this PR

  • protocols/kde-appmenu.xml (new) — verbatim copy from
    plasma-wayland-protocols, MIT licensed. Provenance + SPDX header inline.
  • protocols/gtk-shell.xml (new) — trimmed subset of GTK's gtk-shell.xml,
    LGPL-2.1-or-later. Provenance + trim notes inline.
  • protocols/meson.build — appends the two filenames to wayland_xmls.

Why the GTK XML is trimmed

Upstream gtk-shell.xml declares both gtk_shell1 and gtk_surface1 at version 7. The vast majority of that surface area is unrelated to menus — tiled-state CSD hints (v2), focus-stealing bypass (v3), titlebar gestures (v5), accessibility paths (v7), startup notification (v3), etc. Each would require a stub handler in the compositor.

To keep the implementation surface area minimal, this XML declares both interfaces at version 1, retaining only what's needed for menu publication:

  • gtk_shell1: get_gtk_surface, capabilities event
  • gtk_surface1: set_dbus_properties

plus the other v1 requests that must remain for opcode alignment with the upstream wire format (set_startup_id, system_bell, set_modal, unset_modal, present).

Verification

  • meson setup build && meson compile -C build succeeds — wayland-scanner generates kde-appmenu-protocol.{c,h} and gtk-shell-protocol.{c,h} with no warnings.
  • Both XMLs are well-formed (xmllint --noout).
  • Smoke-tested that mango still launches and mmsg -g output is unchanged from main.

@81reap 81reap marked this pull request as ready for review April 7, 2026 03:55
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.

1 participant