Skip to content

refactor: drop unneeded WLR_VERSION macros - #1444

Open
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/git-commit/c889d52996b0
Open

deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/git-commit/c889d52996b0

Conversation

@deepin-wm

@deepin-wm deepin-wm commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

WM-528

Summary

waylib and treeland only support a pinned wlroots version (0.20), and the CMake WLROOTS_VERSION sanity check already covers that. The WLR_VERSION macros in the generated wconfig.h had no remaining consumers, so they are removed:

  • waylib/src/server/cmake/wconfig.h.in: drop WLR_VERSION / WLR_VERSION_MAJOR/MINOR/PATCH; keep the WLR_HAVE_* feature macros still used by wglobal.h etc.
  • waylib/src/server/CMakeLists.txt: drop the three pkg_get_variable(WLR_VERSION_*) lines; WLROOTS_VERSION stays for the wlroots CMake export sanity check.
  • waylib/src/server/kernel/wglobal.h: drop the always-true WLR_VERSION_MINOR > 16 condition from ENABLE_VULKAN_RENDER (wlroots is pinned to 0.20).

Test recommendations

  1. Configure and build treeland (cmake --preset=default + build): the generated wconfig.h contains no WLR_VERSION macros
  2. Build waylib standalone against waylib-wlroots.pc: WLR_HAVE_* feature macros stay intact
  3. Verify the Vulkan rendering path (ENABLE_VULKAN_RENDER) still compiles and enables with wlroots 0.20

Summary by Sourcery

Remove unused wlroots version macros and rely on the pinned wlroots version for Vulkan rendering support.

Enhancements:

  • Remove obsolete wlroots version metadata and simplify Vulkan rendering feature detection for the pinned wlroots release.

Build:

  • Stop exporting and consuming unused wlroots major, minor, and patch version variables while retaining the wlroots version sanity check and feature metadata.

1. Remove WLR_VERSION/WLR_VERSION_MAJOR/MINOR/PATCH from waylib's
   wconfig.h.in; WLR_HAVE_* feature macros are kept in use.
2. Drop the pkg_get_variable(WLR_VERSION_*) lines in
   waylib/src/server/CMakeLists.txt; WLROOTS_VERSION stays for the
   wlroots CMake export sanity check.
3. Remove the always-true WLR_VERSION_MINOR > 16 condition from
   ENABLE_VULKAN_RENDER (wlroots is pinned to 0.20).

Log: No user-facing changes

Influence:
1. Configure and build treeland: generated wconfig.h contains no WLR_VERSION macros
2. Build waylib standalone against waylib-wlroots.pc: feature macros stay intact
3. Verify Vulkan rendering path (ENABLE_VULKAN_RENDER) still compiles with wlroots 0.20

refactor: 移除不再需要的 WLR_VERSION 宏

1. waylib 的 wconfig.h.in 删除 WLR_VERSION/WLR_VERSION_MAJOR/MINOR/PATCH
   宏,保留仍在使用的 WLR_HAVE_* feature 宏
2. 删除 waylib/src/server/CMakeLists.txt 中 pkg_get_variable(WLR_VERSION_*)
   三行;WLROOTS_VERSION 保留用于 wlroots CMake export 存在性检查
3. ENABLE_VULKAN_RENDER 条件去掉恒真的 WLR_VERSION_MINOR > 16
   (wlroots 锁定 0.20)

Log: 无用户可见变化

Influence:
1. 配置并编译 treeland:生成的 wconfig.h 不再包含任何 WLR_VERSION 宏
2. waylib standalone 方式基于 waylib-wlroots.pc 构建:feature 宏保持完整
3. 验证 Vulkan 渲染路径(ENABLE_VULKAN_RENDER)在 wlroots 0.20 下正常编译
@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@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

@sourcery-ai

sourcery-ai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This refactor removes unused wlroots version-component metadata from generated configuration and standalone CMake setup, while preserving feature macros and the WLROOTS_VERSION sanity check. Vulkan rendering now depends only on wlroots Vulkan support and Qt Vulkan availability, consistent with the pinned wlroots 0.20 dependency.

Flow diagram for simplified Vulkan render capability detection

flowchart LR
    W[WLR_HAVE_VULKAN_RENDERER] --> C{Qt Vulkan enabled}
    Q["QT_CONFIG(vulkan)"] --> C
    C -->|yes| E[ENABLE_VULKAN_RENDER]
    C -->|no| D[Vulkan rendering disabled]
Loading

File-Level Changes

Change Details Files
Remove obsolete wlroots version metadata while retaining feature detection and the pinned-version sanity check.
  • Stop reading wlroots major, minor, and patch values from the installed pkg-config metadata.
  • Keep WLROOTS_VERSION validation and WLR_HAVE_* feature propagation for standalone builds.
  • Remove generated WLR_VERSION macros from the configuration header template.
waylib/src/server/CMakeLists.txt
waylib/src/server/cmake/wconfig.h.in
Simplify Vulkan renderer enablement to rely on supported feature detection and the pinned wlroots release.
  • Enable Vulkan rendering when wlroots advertises Vulkan support and Qt Vulkan is available.
  • Remove the redundant minor-version threshold condition.
waylib/src/server/kernel/wglobal.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-wm
deepin-wm marked this pull request as ready for review September 24, 2026 08:42

@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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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