Skip to content

[WIP] Prototype a Dispatch2/GlobalDispatch2 trait to dispatch delegate macros to oblivion#2008

Draft
ids1024 wants to merge 50 commits intoSmithay:masterfrom
ids1024:dispatch2
Draft

[WIP] Prototype a Dispatch2/GlobalDispatch2 trait to dispatch delegate macros to oblivion#2008
ids1024 wants to merge 50 commits intoSmithay:masterfrom
ids1024:dispatch2

Conversation

@ids1024
Copy link
Copy Markdown
Member

@ids1024 ids1024 commented Apr 24, 2026

Description

See Smithay/client-toolkit#519 for a bit more context.

At present, this replaces delegate_compositor! with a single generic delegate_dispatch2! macro. It should be possible to update all the dispatch implementations this way.

If there are no issues with this, since smithay is less strict about API breaks than wayland-rs, we could merge this in smithay (compositors mostly should just need to add delegate_dispatch2! and remove the other macro calls). Then the next wayland-rs version (Smithay/wayland-rs#900) can incorporate the updated version of the trait. At which point the macro is no longer necessary, and more type bounds can be remove as implied.

Checklist

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 30.99825% with 394 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.99%. Comparing base (e84a4ca) to head (dd3428b).
⚠️ Report is 68 commits behind head on master.

Files with missing lines Patch % Lines
src/wayland/dmabuf/dispatch.rs 0.00% 32 Missing ⚠️
src/wayland/image_copy_capture/mod.rs 6.89% 27 Missing ⚠️
src/wayland/input_method/input_method_handle.rs 0.00% 17 Missing ⚠️
src/wayland/pointer_constraints.rs 15.78% 16 Missing ⚠️
src/wayland/pointer_gestures.rs 0.00% 15 Missing ⚠️
src/wayland/text_input/text_input_handle.rs 0.00% 15 Missing ⚠️
src/wayland/xdg_foreign/handlers.rs 0.00% 15 Missing ⚠️
src/wayland/shell/xdg/handlers/surface.rs 33.33% 14 Missing ⚠️
src/wayland/xdg_activation/dispatch.rs 0.00% 14 Missing ⚠️
src/wayland/compositor/handlers.rs 43.47% 13 Missing ⚠️
... and 44 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2008      +/-   ##
==========================================
- Coverage   18.73%   15.99%   -2.74%     
==========================================
  Files         182      183       +1     
  Lines       28934    29208     +274     
==========================================
- Hits         5421     4673     -748     
- Misses      23513    24535    +1022     
Flag Coverage Δ
wlcs-buffer ?
wlcs-core 15.61% <30.12%> (-0.37%) ⬇️
wlcs-output 6.94% <26.61%> (+0.04%) ⬆️
wlcs-pointer-input ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants