Skip to content

fix(loader): gate wayland platform interface on env - #491

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fork-from-master-0805/bug-372253
Aug 5, 2026
Merged

fix(loader): gate wayland platform interface on env#491
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fork-from-master-0805/bug-372253

Conversation

@MyLeeJiEun

@MyLeeJiEun MyLeeJiEun commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
  1. Register DQWaylandPlatformInterface only when dde-shell sets DDE_TRAY_LOADER_REGISTER_PLATFORM_INTERFACE, marking the process as hosted by the dockplugin compositor.
  2. Register before LoaderApplication construction so systemTheme picks up plugin_manager_v1-synced attributes (active color, theme, fonts) instead of falling back to DTreelandPlatformInterface.
  3. Keep the default platform interface on native Wayland/X11 sessions, avoiding regressions outside dockplugin hosting.
  4. Add dde-shell (>> 2.0.52) build dependency in debian/control.

Log: Register the Wayland platform interface only when the tray loader is hosted by the dockplugin compositor.
Influence: Tray plugin colors/themes sync only under dockplugin hosting; native sessions unaffected.

fix(loader): 按环境变量注册 Wayland 平台接口

  1. 仅在 dde-shell 设置 DDE_TRAY_LOADER_REGISTER_PLATFORM_INTERFACE(即由 dockplugin 合成器托管)时注册 DQWaylandPlatformInterface。
  2. 在 LoaderApplication 构造前注册,确保 systemTheme 能获取 plugin_manager_v1 同步的活动色、主题、字体等属性,而非回退到 DTreelandPlatformInterface。
  3. 原生 Wayland/X11 会话保持默认平台接口,避免非托管场景回归。
  4. debian/control 增加 dde-shell (>> 2.0.52) 构建依赖。

Log: 仅当托盘加载器由 dockplugin 合成器托管时注册 Wayland 平台接口。
PMS: BUG-372253
Influence: 托盘插件仅在 dockplugin 托管时同步活动色与主题,原生会话不受影响。

Summary by Sourcery

Gate Wayland platform interface registration on a dedicated environment variable and ensure it occurs before LoaderApplication initialization to keep native sessions unchanged while enabling dockplugin-hosted tray theming.

Bug Fixes:

  • Prevent unintended use of the Wayland platform interface in native Wayland/X11 sessions by registering it only when explicitly requested via an environment variable.

Build:

  • Add dde-shell (>> 2.0.52) as a build dependency in debian control to support environment-gated platform interface registration.

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

Sorry @MyLeeJiEun, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

Hi @MyLeeJiEun. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai

sourcery-ai Bot commented Aug 5, 2026

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

Reviewer's Guide

Gates registration of the Wayland-specific platform interface on an environment variable set by dde-shell, ensures it is registered before LoaderApplication construction so system theme picks up dockplugin-synced attributes, and adds a debian build dependency on a recent dde-shell.

Sequence diagram for gating DQWaylandPlatformInterface registration on environment variable

sequenceDiagram
    participant LoaderMain
    participant Environment
    participant DPlatformInterfaceFactory
    participant LoaderApplication
    participant DGuiApplicationHelper
    participant systemTheme

    LoaderMain->>Environment: qEnvironmentVariableIsSet(DDE_TRAY_LOADER_REGISTER_PLATFORM_INTERFACE)
    alt env var set
        LoaderMain->>DPlatformInterfaceFactory: registerInterface(lambda DPlatformTheme)
        DPlatformInterfaceFactory-->>systemTheme: use DQWaylandPlatformInterface
    else env var not set
        note over DPlatformInterfaceFactory,systemTheme: DTreelandPlatformInterface remains default
    end

    LoaderMain->>LoaderApplication: LoaderApplication(argc, argv)
    LoaderApplication->>DGuiApplicationHelper: instance()
    DGuiApplicationHelper->>systemTheme: systemTheme
    systemTheme-->>LoaderApplication: plugin_manager_v1 synced attributes (if DQWaylandPlatformInterface)
Loading

File-Level Changes

Change Details Files
Gate DQWaylandPlatformInterface registration on an environment variable and move it to run before LoaderApplication construction so system theme initialization uses the correct platform interface only when hosted by the dockplugin compositor.
  • Replace the previous qAddPreRoutine-based registration that ran on non-X11 platforms with explicit early registration guarded by the DDE_TRAY_LOADER_REGISTER_PLATFORM_INTERFACE environment variable.
  • Document in comments why registration must occur before QCoreApplication/LoaderApplication construction due to early systemTheme initialization via DGuiApplicationHelper.
  • Retain default DTreelandPlatformInterface behavior when the environment variable is not set, keeping native Wayland/X11 sessions unchanged.
src/loader/main.cpp
Declare a build-time dependency on a sufficiently new dde-shell that can set the new environment variable.
  • Add dde-shell (>> 2.0.52) to the Build-Depends list so the tray loader can rely on the environment-based hosting signal.
debian/control

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

@MyLeeJiEun
MyLeeJiEun force-pushed the fork-from-master-0805/bug-372253 branch from 9add10c to df9a70a Compare August 5, 2026 07:43
1. Register DQWaylandPlatformInterface only when dde-shell sets DDE_TRAY_LOADER_REGISTER_PLATFORM_INTERFACE, marking the process as hosted by the dockplugin compositor.
2. Register before LoaderApplication construction so systemTheme picks up plugin_manager_v1-synced attributes (active color, theme, fonts) instead of falling back to DTreelandPlatformInterface.
3. Keep the default platform interface on native Wayland/X11 sessions, avoiding regressions outside dockplugin hosting.
4. Add dde-shell (>> 2.0.52) build dependency in debian/control.

Log: Register the Wayland platform interface only when the tray loader is hosted by the dockplugin compositor.
Influence: Tray plugin colors/themes sync only under dockplugin hosting; native sessions unaffected.

fix(loader): 按环境变量注册 Wayland 平台接口

1. 仅在 dde-shell 设置 DDE_TRAY_LOADER_REGISTER_PLATFORM_INTERFACE(即由 dockplugin 合成器托管)时注册 DQWaylandPlatformInterface。
2. 在 LoaderApplication 构造前注册,确保 systemTheme 能获取 plugin_manager_v1 同步的活动色、主题、字体等属性,而非回退到 DTreelandPlatformInterface。
3. 原生 Wayland/X11 会话保持默认平台接口,避免非托管场景回归。
4. debian/control 增加 dde-shell (>> 2.0.52) 构建依赖。

Log: 仅当托盘加载器由 dockplugin 合成器托管时注册 Wayland 平台接口。
PMS: BUG-372253
Influence: 托盘插件仅在 dockplugin 托管时同步活动色与主题,原生会话不受影响。
@MyLeeJiEun
MyLeeJiEun force-pushed the fork-from-master-0805/bug-372253 branch from df9a70a to ec2dd7c Compare August 5, 2026 08:19
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, MyLeeJiEun

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

@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot

deepin-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

This pr cannot be merged! (status: blocked)

@MyLeeJiEun

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit 42e7b26 into linuxdeepin:master Aug 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants