Skip to content

fix: enable real-time volume adjustment in sound applet - #501

Merged
xionglinlin merged 1 commit into
linuxdeepin:release/2500from
xionglinlin:release/2500
Sep 1, 2026
Merged

fix: enable real-time volume adjustment in sound applet#501
xionglinlin merged 1 commit into
linuxdeepin:release/2500from
xionglinlin:release/2500

Conversation

@xionglinlin

@xionglinlin xionglinlin commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

目的

将 master 分支的最新提交 cherry-pick 到 release/2500 分支。

变更

fix: enable real-time volume adjustment in sound applet

  1. Remove setTracking(false) calls from both SoundApplet and
    SoundQuickPanel
  2. This restores the default tracking behavior that emits value changes
    during slider drag
  3. Previously the tracking disabled prevented the volume from updating
    smoothly as the user dragged the slider
  4. The volume now adjusts in real-time as the slider moves, providing
    immediate audio feedback

Log: Fixed volume slider not responding in real-time during adjustment

Influence:

  1. Test volume adjustment by dragging the slider in the dock sound
    applet
  2. Verify audio volume changes smoothly while dragging instead of only
    on release
  3. Test the quick panel volume slider for the same real-time behavior
  4. Ensure volume updates correctly when using keyboard shortcuts or
    slider steps
  5. Verify no regression in volume slider functionality across different
    audio devices

fix: 修复声音调节不能实时变化的问题

  1. 移除 SoundApplet 和 SoundQuickPanel 中的 setTracking(false) 调用
  2. 恢复默认的跟踪行为,使滑块在拖动过程中持续发出值变化事件
  3. 此前禁用跟踪导致音量在拖动过程中无法实时更新
  4. 音量现在随滑块移动实时调整,提供即时音频反馈

Log: 修复音量滑块在调节时不能实时响应的问题

Influence:

  1. 测试在任务栏声音组件中拖拽音量滑块
  2. 验证音量在拖动过程中平滑变化,而不是仅在松开时更新
  3. 测试快捷面板音量滑块的实时响应行为
  4. 验证使用键盘快捷键或步进调节时音量更新正常
  5. 确认在不同音频设备上音量滑块功能无回归

PMS: BUG-375031
Change-Id: I3382aecb30658755616c3c5c470fa759c37ae32d

涉及文件

  • plugins/dde-dock/sound/soundapplet.cpp
  • plugins/dde-dock/sound/soundquickpanel.cpp

Summary by Sourcery

Enable immediate audio volume adjustment across the dock sound applet and quick panel.

Bug Fixes:

  • Restore real-time volume updates while dragging sliders in the dock sound applet and quick panel.

Chores:

  • Update SPDX copyright years for the modified sound components.

1. Remove `setTracking(false)` calls from both SoundApplet and
SoundQuickPanel
2. This restores the default tracking behavior that emits value changes
during slider drag
3. Previously the tracking disabled prevented the volume from updating
smoothly as the user dragged the slider
4. The volume now adjusts in real-time as the slider moves, providing
immediate audio feedback

Log: Fixed volume slider not responding in real-time during adjustment

Influence:
1. Test volume adjustment by dragging the slider in the dock sound
applet
2. Verify audio volume changes smoothly while dragging instead of only
on release
3. Test the quick panel volume slider for the same real-time behavior
4. Ensure volume updates correctly when using keyboard shortcuts or
slider steps
5. Verify no regression in volume slider functionality across different
audio devices

fix: 修复声音调节不能实时变化的问题

1. 移除 SoundApplet 和 SoundQuickPanel 中的 `setTracking(false)` 调用
2. 恢复默认的跟踪行为,使滑块在拖动过程中持续发出值变化事件
3. 此前禁用跟踪导致音量在拖动过程中无法实时更新
4. 音量现在随滑块移动实时调整,提供即时音频反馈

Log: 修复音量滑块在调节时不能实时响应的问题

Influence:
1. 测试在任务栏声音组件中拖拽音量滑块
2. 验证音量在拖动过程中平滑变化,而不是仅在松开时更新
3. 测试快捷面板音量滑块的实时响应行为
4. 验证使用键盘快捷键或步进调节时音量更新正常
5. 确认在不同音频设备上音量滑块功能无回归

PMS: BUG-375031
Change-Id: I3382aecb30658755616c3c5c470fa759c37ae32d
@sourcery-ai

sourcery-ai Bot commented Sep 1, 2026

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

Reviewer's Guide

The PR fixes delayed volume updates by removing setTracking(false) from both sound sliders, restoring default continuous value-change events during dragging while leaving slider configuration otherwise unchanged; it also updates copyright year ranges.

Sequence diagram for real-time volume slider adjustment

sequenceDiagram
    actor User
    participant Slider as SoundSlider
    participant SoundModel

    User->>Slider: Drag slider
    Slider-->>SoundModel: valueChanged(value)
    SoundModel-->>User: Immediate audio volume feedback
Loading

File-Level Changes

Change Details Files
Re-enable continuous slider value tracking so volume changes are propagated during drag operations.
  • Remove explicit tracking disablement from the dock sound applet slider.
  • Remove explicit tracking disablement from the quick panel slider.
  • Retain existing range, page-step, and value initialization behavior.
plugins/dde-dock/sound/soundapplet.cpp
plugins/dde-dock/sound/soundquickpanel.cpp
Update SPDX copyright year ranges in the two modified sound UI implementations.
  • Extend the copyright year through 2026.
plugins/dde-dock/sound/soundapplet.cpp
plugins/dde-dock/sound/soundquickpanel.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

@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 ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 100 分,大于 70 分通过阈值,代码质量符合要求。本次变更移除了 SoundApplet 和 SoundQuickPanel 中的 setTracking(false) 调用,恢复了滑块拖动时的实时音量调节功能,变更简洁明确,无安全风险。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 无需修改,语法正确,逻辑清晰


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 代码变更简洁明了,无需额外修改


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 性能良好,实时音量调节是预期行为


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无需安全加固


💡 改进建议代码示例

// 本次变更已为正确的修复方式,无需额外代码示例
// 移除 setTracking(false) 即可恢复滑块实时跟踪行为

// soundapplet.cpp - initUi() 中已移除:
// m_volumeSlider->slider()->setTracking(false);

// soundquickpanel.cpp - initUi() 中已移除:
// m_sliderContainer->slider()->setTracking(false);
//
// Qt滑块默认 tracking=true,移除 setTracking(false) 后
// valueChanged 信号将在拖动过程中持续发射,实现实时音量调节

本报告由 AI 代码审查工具自动生成

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, xionglinlin

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

@xionglinlin
xionglinlin merged commit 44d02fe into linuxdeepin:release/2500 Sep 1, 2026
9 checks passed
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