Skip to content

feat: OSD Wayland adaptation, Bluetooth types, unit tests and AT-SPI tests - #1763

Draft
pengfeixx wants to merge 1 commit into
linuxdeepin:masterfrom
pengfeixx:agent/developer/39f701dddfd6
Draft

pengfeixx wants to merge 1 commit into
linuxdeepin:masterfrom
pengfeixx:agent/developer/39f701dddfd6

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR implements OSD Wayland adaptation, Bluetooth type additions, unit tests, and AT-SPI test expectations for dde-shell.

Changes

  1. Brightness applet v1→v2 protocol migration — treelandbrightness.cpp/.h, CMakeLists.txt
  2. Display mode applet Wayland adaptation — displaymodeapplet.h/.cpp
  3. Bluetooth OSD type additions — main.qml, new osd_bluetooth_on.dci / osd_bluetooth_off.dci
  4. OSD panel m_osdTimer initialization moved to constructor — osdpanel.cpp
  5. Unit tests added — osdpanel_test.cpp, audioapplet_test.cpp, brightnessapplet_test.cpp, displaymodeapplet_test.cpp, CMakeLists.txt updates
  6. AT-SPI test expected values — expected_names.yaml

Related Issue

DDE-445

Summary by Sourcery

Adapt OSD functionality for Wayland, add Bluetooth notifications, and expand automated coverage for OSD components.

New Features:

  • Add Bluetooth on/off OSD types and icons.
  • Add unit coverage for the OSD panel and audio, brightness, and display-mode applets.

Bug Fixes:

  • Initialize the OSD panel timer during construction so it is available before panel initialization.

Enhancements:

  • Adapt brightness reporting to the Treeland output-manager unstable v2 Wayland protocol.
  • Handle display-mode OSD behavior on Wayland by presenting it as unavailable until protocol support is available.

Build:

  • Add CMake targets and test registration for the new OSD unit tests.

Tests:

  • Add AT-SPI expected accessibility entries for OSD QML elements.

@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: pengfeixx

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 Oct 15, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR updates OSD integration for Wayland by migrating brightness to Treeland output-manager v2 and disabling unsupported display-mode actions, adds Bluetooth OSD resources, initializes the panel timer earlier, expands AT-SPI expectations, and introduces standalone GoogleTest/CTest coverage for OSD panels and applets.

Sequence diagram for Wayland OSD display-mode handling

sequenceDiagram
    participant OSD as DisPlayModeApplet
    participant Platform as DGuiApplicationHelper
    participant Base as DApplet

    OSD->>Platform: testAttribute(IsWaylandPlatform)
    Platform-->>OSD: m_isWayland
    OSD->>Base: load()
    OSD->>OSD: sync()
    alt Wayland platform
        OSD-->>OSD: setState(2)
        OSD-->>OSD: next() returns
        OSD-->>OSD: doAction() returns
    else Non-Wayland platform
        OSD->>OSD: fetchPlanItems()
        OSD->>OSD: fetchCurrentPlanItem()
    end
Loading

Sequence diagram for brightness OSD Wayland protocol v2

sequenceDiagram
    participant Brightness as TreelandBrightness
    participant Manager as treeland_output_manager_v2
    participant Output as wl_output
    participant Control as TreelandPictureControl
    participant OSD as Brightness OSD

    Brightness->>Manager: get_picture_control(output)
    Manager-->>Brightness: treeland_output_picture_control_v2
    Brightness->>Control: construct control
    Control-->>OSD: treeland_output_picture_control_v2_brightness(brightness)
    Control->>OSD: brightnessChanged(brightness)
Loading

Flow diagram for OSD test coverage and resources

flowchart LR
    Sources[OSD applets and panel] --> Tests[GoogleTest and CTest targets]
    Sources --> Resources[Bluetooth OSD types and icons]
    Tests --> SPI[AT-SPI expected names]
    Sources --> Wayland[Wayland-specific behavior]
Loading

File-Level Changes

Change Details Files
Migrates the brightness OSD Wayland client from the v1 color-control protocol to the unstable v2 picture-control protocol.
  • Regenerates and includes the v2 protocol bindings.
  • Renames the control wrapper and updates brightness event/accessor handling.
  • Binds picture control objects from the output manager while preserving read-only brightness reporting.
panels/notification/osd/brightness/CMakeLists.txt
panels/notification/osd/brightness/treelandbrightness.cpp
panels/notification/osd/brightness/treelandbrightness.h
Adapts display-mode OSD behavior for Wayland environments where display-mode switching is unavailable.
  • Detects the Wayland platform during applet loading.
  • Reports a disabled state and prevents display-mode actions on Wayland.
  • Initializes the display-mode state explicitly.
panels/notification/osd/displaymode/displaymodeapplet.cpp
panels/notification/osd/displaymode/displaymodeapplet.h
Adds Bluetooth OSD type/icon mappings and corresponding accessibility expectations.
  • Registers Bluetooth-on and Bluetooth-off OSD types in the default QML model.
  • Extends AT-SPI expected element data for OSD windows and applet content.
  • Adds Bluetooth icon assets.
panels/notification/osd/default/package/main.qml
panels/notification/osd/default/package/osd_bluetooth_on.dci
panels/notification/osd/default/package/osd_bluetooth_off.dci
tests/at/spi/expected_names.yaml
Moves OSD timer setup into object construction to make timer-dependent behavior available before panel initialization.
  • Creates and configures the single-shot OSD timer in the constructor.
  • Removes duplicate timer setup from init().
panels/notification/osd/osdpanel.cpp
Introduces GoogleTest coverage and CTest integration for core OSD panel and applet behavior.
  • Adds unit and DBus-oriented tests for panel visibility, timers, OSD type changes, and service calls.
  • Adds property, signal, synchronization, and graceful no-backend tests for audio and brightness applets.
  • Adds DPItem and Wayland-related display-mode behavior tests.
  • Adds dedicated CMake targets, protocol generation, dependencies, and test registration.
tests/panels/notification/CMakeLists.txt
tests/panels/notification/osd/CMakeLists.txt
tests/panels/notification/osd/osdpanel_test.cpp
tests/panels/notification/osd/audioapplet_test.cpp
tests/panels/notification/osd/brightnessapplet_test.cpp
tests/panels/notification/osd/displaymodeapplet_test.cpp

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-bot

deepin-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.58
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1765

@deepin-bot

deepin-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.59
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1766

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.

3 participants