Skip to content

fix(osd): speed up Super+P display-mode checkmarks - #1849

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master
Nov 30, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master

Conversation

@52cyb

@52cyb 52cyb commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
  1. Dispatch OSD requests immediately by removing the fixed 100 ms delay.
  2. Read display state on open. Advance the checkmark from the cached list
    on repeat presses and apply the final selection after two seconds.
  3. Retry failed list reads. Start from the first item if the active mode
    or primary output is unknown.
  4. Update audio OSD from Volume and Mute notifications. Refresh volume,
    mute and the volume boost setting when the default output changes.

Log: Improve Super+P checkmark response and refresh audio OSD on changes

Influence:

  1. Verify the first Super+P press shows the active display mode.
  2. Hold Super and tap P repeatedly. Verify the checkmark advances and
    only the final selection is applied after two seconds.
  3. Verify recovery after a failed display list or mode read.
  4. Test volume up from zero, mute and switching the default audio output
    while the OSD is visible. Check the progress bar and 100% mark.

fix(osd): 加快 Super+P 切换显示模式时的勾选更新

  1. 移除 OSD 固定的 100 ms 延时,收到请求后立即派发。
  2. 首次打开读取显示状态,连按时用缓存列表推进勾选,
    停按两秒后应用最后选中的模式。
  3. 候选列表读取失败时重试,当前模式或主屏未知时从首项开始轮选。
  4. 根据音量和静音通知补刷音量 OSD,默认输出切换时同时刷新
    音量、静音和音量增强设置。

Influence:

  1. 首按 Super+P,确认面板勾选当前模式。
  2. 按住 Super 连按 P,确认勾选逐次推进,停按两秒只应用最后一项。
  3. 验证候选列表或实际模式读取失败后仍能恢复轮选。
  4. 验证音量从零回升、静音和面板可见时切换默认输出,
    检查进度条和 100% 刻度是否正确。

Log: 加快 Super+P 勾选更新,并在音量状态变化后补刷面板
PMS: BUG-383567

Summary by Sourcery

Improve OSD responsiveness and state synchronization for display-mode cycling and audio changes.

New Features:

  • Refresh the audio OSD in response to default-output, volume, and mute state changes.

Bug Fixes:

  • Make display-mode OSD requests appear immediately and keep repeated Super+P selections synchronized with the displayed checkmark.
  • Recover display-mode cycling when candidate lists or active display state cannot be read.

Enhancements:

  • Refresh display state when opening the display-mode OSD and defer applying the selected mode until cycling ends.

@sourcery-ai

sourcery-ai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Uses of the API

Change the display-mode OSD request flow so repeated monitor-switch requests advance the cached selection without synchronizing on every press.

  • panels/notification/osd/displaymode/package/main.qml L21-33

Implementation

Track display-list validity and refresh or advance display state so failed reads can recover and the final selection can be applied after the repeat sequence.

  • panels/notification/osd/displaymode/displaymodeapplet.cpp L116-126, L131-134 (+3 small edits)
  • panels/notification/osd/displaymode/displaymodeapplet.h L77-78, L85

Dispatch OSD requests immediately and manage the visible-period and hide timers so a pending hide does not truncate a newer request.

  • panels/notification/osd/osdpanel.cpp L51-54, L72-78 (+4 small edits)
  • panels/notification/osd/osdpanel.h L1, L49

Cache the active audio sink's mute and volume state, subscribe to property changes, and refresh audio OSD state when properties or the default sink change.

  • panels/notification/osd/audio/audioapplet.cpp L18-36, L49-62, L80-148 (+5 small edits)
  • panels/notification/osd/audio/audioapplet.h L9-14, L47-55 (+3 small edits)

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 found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="panels/notification/osd/displaymode/package/main.qml" line_range="25" />
<code_context>
-                }
-            } else if (osdType === "SwitchMonitors") {
-                if (Panel.lastOsdType() === osdType) {
-                    Applet.next()
-                }
-            }
</code_context>
<issue_to_address>
**Repeat presses use stale choices**

When the initial output fetch fails and recovers, or outputs or the current mode change after sync while the OSD remains visible, `Applet.next()` advances the cached plan without calling `Applet.sync()`, so an empty plan stays empty and changed outputs or modes leave stale choices; the checkmark stays unchanged or points to the wrong choice, and the delayed action targets an unavailable or unintended mode.

Call `Applet.sync()` before `Applet.next()` on repeat presses.

Also at `panels/notification/osd/displaymode/package/main.qml:24`, `panels/notification/osd/displaymode/package/main.qml:26`, `panels/notification/osd/osdpanel.cpp:80`.
</issue_to_address>

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

@deepin-ci-robot

deepin-ci-robot commented Nov 24, 2026 •

Copy link
Copy Markdown

⚠️ OBS CI 构建警告日志 (Commit: 9af85fe3)

提示:以下为 OBS CI 构建中 Lintian 检测到的警告信息,默认折叠,点击展开查看详情。完整日志请参阅对应构建状态链接。

deepin_develop / aarch64 (Lintian 警告: 15 条)
[  898s] W: dde-shell: desktop-command-not-in-package bin/false [usr/share/applications/org.deepin.dde-shell.desktop]
[  898s] N: 
[  898s] N:   The desktop entry specifies a Command that does not match any of the
[  898s] N:   executables shipped in the package.
[  898s] N:   
[  898s] N:   This condition is often caused by a typo, or the desktop file was not
[  898s] N:   updated after the installed path of the executable was modified.
[  898s] N:   
[  898s] N:   Packages should ship executables that are used as commands in desktop
[  898s] N:   files.
[  898s] N: 
[  898s] N:   Visibility: warning
[  898s] N:   Show-Always: no
[  898s] N:   Check: menu-format
[  898s] N: 
[  898s] N:
[  898s] W: dde-shell: link-to-shared-library-in-wrong-package usr/lib/aarch64-linux-gnu/libds-notification-shared.so.2.0.61 [usr/lib/aarch64-linux-gnu/libds-notification-shared.so]
[  898s] N: 
[  898s] N:   Although this package is not a "-dev" package, it installs a
[  898s] N:   "libsomething.so" symbolic link referencing the corresponding shared
[  898s] N:   library. When the link doesn't include the version number, it is used by
[  898s] N:   the linker when other programs are built against this shared library.
[  898s] N:   
[  898s] N:   Shared libraries are supposed to place such symbolic links in their
[  898s] N:   respective "-dev" packages, so it is a bug to include it with the main
[  898s] N:   library package.
[  898s] N:   
[  898s] N:   However, if this is a small package which includes the runtime and the
[  898s] N:   development libraries, this is not a bug. In the latter case, please
[  898s] N:   override this warning.
[  898s] N: 
[  898s] N:   Please refer to Development files (Section 8.4) in the Debian Policy
[  898s] N:   Manual for details.
[  898s] N: 
[  898s] N:   Visibility: warning
[  898s] N:   Show-Always: no
[  898s] N:   Check: libraries/shared/links
[  898s] N:   Renamed from: non-dev-pkg-with-shlib-symlink
[  898s] N: 
[  898s] N:
[  898s] W: dde-shell: no-manual-page [usr/bin/dde-shell]
[  898s] N: 
[  898s] N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have
[  898s] N:   a manual page
[  898s] N:   
[  898s] N:   Note that though the man program has the capability to check for several
[  898s] N:   program names in the NAMES section, each of these programs should have its
[  898s] N:   own manual page (a symbolic link to the appropriate manual page is
[  898s] N:   sufficient) because other manual page viewers such as xman or tkman don't
[  898s] N:   support this.
[  898s] N:   
[  898s] N:   If the name of the manual page differs from the binary by case, man may be
[  898s] N:   able to find it anyway; however, it is still best practice to match the
[  898s] N:   exact capitalization of the executable in the manual page.
[  898s] N:   
[  898s] N:   If the manual pages are provided by another package on which this package
[  898s] N:   depends, Lintian may not be able to determine that manual pages are
[  898s] N:   available. In this case, after confirming that all binaries do have manual
[  898s] N:   pages after this package and its dependencies are installed, please add a
[  898s] N:   Lintian override.
[  898s] N: 
[  898s] N:   Please refer to Manual pages (Section 12.1) in the Debian Policy Manual
[  898s] N:   for details.
[  898s] N: 
[  898s] N:   Visibility: warning
[  898s] N:   Show-Always: no
[  898s] N:   Check: documentation/manual
[  898s] N:   Renamed from: binary-without-manpage
[  898s] N: 
[  898s] N:
[  898s] W: dde-shell source: no-nmu-in-changelog [debian/changelog:1]
[  898s] N: 
[  898s] N:   When you NMU a package, that fact should be mentioned on the first line in
[  898s] N:   the changelog entry. Use the words "NMU" or "Non-maintainer upload" (case
[  898s] N:   insensitive).
[  898s] N:   
[  898s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  898s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  898s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  898s] N:   package (not intended for Debian), you can suppress this warning by
[  898s] N:   putting "local" in the version number or "local package" on the first line
[  898s] N:   of the changelog entry.
[  898s] N: 
[  898s] N:   Please refer to Using the DELAYED/ queue (Section 5.11.3) in the Debian
[  898s] N:   Developer's Reference for details.
[  898s] N: 
[  898s] N:   Visibility: warning
[  898s] N:   Show-Always: no
[  898s] N:   Check: nmu
[  898s] N:   Renamed from: changelog-should-mention-nmu
[  898s] N: 
[  898s] N:
[  898s] W: dde-shell: package-name-doesnt-match-sonames libds-notification-shared2
[  898s] N: 
[  898s] N:   The package name of a library package should usually reflect the soname of
[  898s] N:   the included library. The package name can determined from the library
[  898s] N:   file name with the following code snippet:
[  898s] N:   
[  898s] N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
[  898s] N:        sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
[  898s] N: 
[  898s] N:   Visibility: warning
[  898s] N:   Show-Always: no
[  898s] N:   Check: libraries/shared/soname
[  898s] N: 
[  898s] N:
[  898s] W: libdde-shell: package-name-doesnt-match-sonames libdde-shell1
[  898s] N:
[  898s] W: libdde-shell-dock: package-name-doesnt-match-sonames libdde-shell-dock1
[  898s] N:
[  898s] W: dde-shell source: source-nmu-has-incorrect-version-number 2.0.61+u062 [debian/changelog:1]
[  898s] N: 
[  898s] N:   A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
[  898s] N:   native package). This is to prevent stealing version numbers from the
[  898s] N:   maintainer.
[  898s] N:   
[  898s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  898s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  898s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  898s] N:   package (not intended for Debian), you can suppress this warning by
[  898s] N:   putting "local" in the version number or "local package" on the first line
[  898s] N:   of the changelog entry.
[  898s] N: 
[  898s] N:   Please refer to NMUs and debian/changelog (Section 5.11.2) in the Debian
[  898s] N:   Developer's Reference for details.
[  898s] N: 
[  898s] N:   Visibility: warning
[  898s] N:   Show-Always: no
[  898s] N:   Check: nmu
[  898s] N: 
[  898s] N:
[  898s] W: dde-shell: unknown-section DDE
[  898s] N: 
[  898s] N:   The "Section:" field in this package's control file is not one of the
[  898s] N:   sections in use on the ftp archive. Valid sections are currently admin,
[  898s] N:   comm, cli-mono, database, debug, devel, doc, editors, electronics,
[  898s] N:   embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio,
[  898s] N:   haskell, httpd, interpreters, java, javascript, kde, libdevel, libs, lisp,
[  898s] N:   localization, kernel, mail, math, misc, net, news, ocaml, oldlibs,
[  898s] N:   otherosfs, perl, php, python, ruby, rust, science, shells, sound, tex,
[  898s] N:   text, utils, vcs, video, web, x11, xfce, zope.
[  898s] N:   
[  898s] N:   The section name should be preceded by either "contrib/", "non-free/" or
[  898s] N:   "non-free-firmware/" if the package is in the according archive area.
[  898s] N: 
[  898s] N:   Please refer to Sections (Section 2.4) in the Debian Policy Manual for
[  898s] N:   details.
[  898s] N: 
[  898s] N:   Visibility: warning
[  898s] N:   Show-Always: no
[  898s] N:   Check: fields/section
[  898s] N: 
[  898s] N:
[  898s] W: dde-shell-example: unknown-section DDE
[  898s] N:
[  898s] W: libdde-shell: unknown-section DDE
[  898s] N:
[  898s] W: libdde-shell-dev: unknown-section DDE
[  898s] N:
[  898s] W: libdde-shell-dock: unknown-section DDE
[  898s] N:
[  898s] W: libdde-shell-dock-dev: unknown-section DDE
[  899s] Warning: mkbaselibs missing in build root, skipping baselibs
deepin_develop / x86_64 (Lintian 警告: 15 条)
[  401s] W: dde-shell: desktop-command-not-in-package bin/false [usr/share/applications/org.deepin.dde-shell.desktop]
[  401s] N: 
[  401s] N:   The desktop entry specifies a Command that does not match any of the
[  401s] N:   executables shipped in the package.
[  401s] N:   
[  401s] N:   This condition is often caused by a typo, or the desktop file was not
[  401s] N:   updated after the installed path of the executable was modified.
[  401s] N:   
[  401s] N:   Packages should ship executables that are used as commands in desktop
[  401s] N:   files.
[  401s] N: 
[  401s] N:   Visibility: warning
[  401s] N:   Show-Always: no
[  401s] N:   Check: menu-format
[  401s] N: 
[  401s] N:
[  401s] W: dde-shell: link-to-shared-library-in-wrong-package usr/lib/x86_64-linux-gnu/libds-notification-shared.so.2.0.61 [usr/lib/x86_64-linux-gnu/libds-notification-shared.so]
[  401s] N: 
[  401s] N:   Although this package is not a "-dev" package, it installs a
[  401s] N:   "libsomething.so" symbolic link referencing the corresponding shared
[  401s] N:   library. When the link doesn't include the version number, it is used by
[  401s] N:   the linker when other programs are built against this shared library.
[  401s] N:   
[  401s] N:   Shared libraries are supposed to place such symbolic links in their
[  401s] N:   respective "-dev" packages, so it is a bug to include it with the main
[  401s] N:   library package.
[  401s] N:   
[  401s] N:   However, if this is a small package which includes the runtime and the
[  401s] N:   development libraries, this is not a bug. In the latter case, please
[  401s] N:   override this warning.
[  401s] N: 
[  401s] N:   Please refer to Development files (Section 8.4) in the Debian Policy
[  401s] N:   Manual for details.
[  401s] N: 
[  401s] N:   Visibility: warning
[  401s] N:   Show-Always: no
[  401s] N:   Check: libraries/shared/links
[  401s] N:   Renamed from: non-dev-pkg-with-shlib-symlink
[  401s] N: 
[  401s] N:
[  401s] W: dde-shell: no-manual-page [usr/bin/dde-shell]
[  401s] N: 
[  401s] N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have
[  401s] N:   a manual page
[  401s] N:   
[  401s] N:   Note that though the man program has the capability to check for several
[  401s] N:   program names in the NAMES section, each of these programs should have its
[  401s] N:   own manual page (a symbolic link to the appropriate manual page is
[  401s] N:   sufficient) because other manual page viewers such as xman or tkman don't
[  401s] N:   support this.
[  401s] N:   
[  401s] N:   If the name of the manual page differs from the binary by case, man may be
[  401s] N:   able to find it anyway; however, it is still best practice to match the
[  401s] N:   exact capitalization of the executable in the manual page.
[  401s] N:   
[  401s] N:   If the manual pages are provided by another package on which this package
[  401s] N:   depends, Lintian may not be able to determine that manual pages are
[  401s] N:   available. In this case, after confirming that all binaries do have manual
[  401s] N:   pages after this package and its dependencies are installed, please add a
[  401s] N:   Lintian override.
[  401s] N: 
[  401s] N:   Please refer to Manual pages (Section 12.1) in the Debian Policy Manual
[  401s] N:   for details.
[  401s] N: 
[  401s] N:   Visibility: warning
[  401s] N:   Show-Always: no
[  401s] N:   Check: documentation/manual
[  401s] N:   Renamed from: binary-without-manpage
[  401s] N: 
[  401s] N:
[  401s] W: dde-shell source: no-nmu-in-changelog [debian/changelog:1]
[  401s] N: 
[  401s] N:   When you NMU a package, that fact should be mentioned on the first line in
[  401s] N:   the changelog entry. Use the words "NMU" or "Non-maintainer upload" (case
[  401s] N:   insensitive).
[  401s] N:   
[  401s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  401s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  401s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  401s] N:   package (not intended for Debian), you can suppress this warning by
[  401s] N:   putting "local" in the version number or "local package" on the first line
[  401s] N:   of the changelog entry.
[  401s] N: 
[  401s] N:   Please refer to Using the DELAYED/ queue (Section 5.11.3) in the Debian
[  401s] N:   Developer's Reference for details.
[  401s] N: 
[  401s] N:   Visibility: warning
[  401s] N:   Show-Always: no
[  401s] N:   Check: nmu
[  401s] N:   Renamed from: changelog-should-mention-nmu
[  401s] N: 
[  401s] N:
[  401s] W: dde-shell: package-name-doesnt-match-sonames libds-notification-shared2
[  401s] N: 
[  401s] N:   The package name of a library package should usually reflect the soname of
[  401s] N:   the included library. The package name can determined from the library
[  401s] N:   file name with the following code snippet:
[  401s] N:   
[  401s] N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
[  401s] N:        sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
[  401s] N: 
[  401s] N:   Visibility: warning
[  401s] N:   Show-Always: no
[  401s] N:   Check: libraries/shared/soname
[  401s] N: 
[  401s] N:
[  401s] W: libdde-shell: package-name-doesnt-match-sonames libdde-shell1
[  401s] N:
[  401s] W: libdde-shell-dock: package-name-doesnt-match-sonames libdde-shell-dock1
[  401s] N:
[  401s] W: dde-shell source: source-nmu-has-incorrect-version-number 2.0.61+u062 [debian/changelog:1]
[  401s] N: 
[  401s] N:   A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
[  401s] N:   native package). This is to prevent stealing version numbers from the
[  401s] N:   maintainer.
[  401s] N:   
[  401s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  401s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  401s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  401s] N:   package (not intended for Debian), you can suppress this warning by
[  401s] N:   putting "local" in the version number or "local package" on the first line
[  401s] N:   of the changelog entry.
[  401s] N: 
[  401s] N:   Please refer to NMUs and debian/changelog (Section 5.11.2) in the Debian
[  401s] N:   Developer's Reference for details.
[  401s] N: 
[  401s] N:   Visibility: warning
[  401s] N:   Show-Always: no
[  401s] N:   Check: nmu
[  401s] N: 
[  401s] N:
[  401s] W: dde-shell: unknown-section DDE
[  401s] N: 
[  401s] N:   The "Section:" field in this package's control file is not one of the
[  401s] N:   sections in use on the ftp archive. Valid sections are currently admin,
[  401s] N:   comm, cli-mono, database, debug, devel, doc, editors, electronics,
[  401s] N:   embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio,
[  401s] N:   haskell, httpd, interpreters, java, javascript, kde, libdevel, libs, lisp,
[  401s] N:   localization, kernel, mail, math, misc, net, news, ocaml, oldlibs,
[  401s] N:   otherosfs, perl, php, python, ruby, rust, science, shells, sound, tex,
[  401s] N:   text, utils, vcs, video, web, x11, xfce, zope.
[  401s] N:   
[  401s] N:   The section name should be preceded by either "contrib/", "non-free/" or
[  401s] N:   "non-free-firmware/" if the package is in the according archive area.
[  401s] N: 
[  401s] N:   Please refer to Sections (Section 2.4) in the Debian Policy Manual for
[  401s] N:   details.
[  401s] N: 
[  401s] N:   Visibility: warning
[  401s] N:   Show-Always: no
[  401s] N:   Check: fields/section
[  401s] N: 
[  401s] N:
[  401s] W: dde-shell-example: unknown-section DDE
[  401s] N:
[  401s] W: libdde-shell: unknown-section DDE
[  401s] N:
[  401s] W: libdde-shell-dev: unknown-section DDE
[  401s] N:
[  401s] W: libdde-shell-dock: unknown-section DDE
[  401s] N:
[  401s] W: libdde-shell-dock-dev: unknown-section DDE
[  401s] Warning: mkbaselibs missing in build root, skipping baselibs

@52cyb
52cyb force-pushed the master branch 5 times, most recently from 202bb3c to c19e4dc Compare November 26, 2026 03:53
Comment thread panels/notification/osd/osdpanel.cpp Outdated
};

// Keep repeat presses behind any OSD requests already scheduled for delivery.
if (m_visible && m_pendingDispatches == 0 && text == QLatin1String("SwitchMonitors")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

osdpanel里不应该有SwitchMonitors这种插件里的类型判断,

@52cyb
52cyb force-pushed the master branch 8 times, most recently from 17217df to 68c1bdb Compare November 30, 2026 06:59
@52cyb 52cyb changed the title fix(osd): speed up checkmark updates during Super+P cycling fix(osd): speed up Super+P display-mode checkmarks Nov 30, 2026
@52cyb

52cyb commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

@sourcery-ai review

@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 found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="panels/notification/osd/audio/audioapplet.cpp" line_range="10" />
<code_context>
 #include "pluginfactory.h"

 #include <QDBusConnection>
+#include <QDBusMessage>
 #include <QDBusPendingCall>
 #include <QDBusReply>
</code_context>
<issue_to_address>
**Audio change notifications stop**

When the session-bus connection cannot install the `PropertiesChanged` subscription, the failed subscription is not logged, retried, or re-established, so `onAudioPropertiesChanged` never receives later volume and mute updates and the OSD stays stale until an explicit sync.

Check the connection result and re-establish the subscription after the bus becomes available, logging failures.
</issue_to_address>

### Comment 2
<location path="panels/notification/osd/audio/audioapplet.cpp" line_range="110" />
<code_context>
 {
-    setVolumeValue(fetchVolume());
-
+    m_sinkPath = fetchDefaultSinkPath();
+    readSinkState(true, true);
     setIncreaseVolume(fetchIncreaseVolume());
</code_context>
<issue_to_address>
**Audio state resets after lookup failure**

When the `DefaultSink` property is invalidated and the follow-up D-Bus read fails transiently, `fetchDefaultSinkPath()` returns an empty path, so `m_sinkPath` is cleared and `readSinkState()` resets the displayed volume and mute state; later sink notifications are rejected, leaving the OSD stale until another default-sink change or explicit sync.

Keep the current sink path and displayed state when the follow-up read fails, and retry the lookup instead of passing an empty path to `readSinkState()`.
</issue_to_address>

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

@52cyb
52cyb force-pushed the master branch 2 times, most recently from 570417f to 90cfbf5 Compare November 30, 2026 08:11
18202781743
18202781743 previously approved these changes Nov 30, 2026
1. Dispatch OSD requests immediately by removing the fixed 100 ms delay.
2. Read display state on open. Advance the checkmark from the cached list
   on repeat presses and apply the final selection after two seconds.
3. Retry failed list reads. Start from the first item if the active mode
   or primary output is unknown.
4. Update audio OSD from Volume and Mute notifications. Refresh volume,
   mute and the volume boost setting when the default output changes.

Log: Improve Super+P checkmark response and refresh audio OSD on changes

Influence:
1. Verify the first Super+P press shows the active display mode.
2. Hold Super and tap P repeatedly. Verify the checkmark advances and
   only the final selection is applied after two seconds.
3. Verify recovery after a failed display list or mode read.
4. Test volume up from zero, mute and switching the default audio output
   while the OSD is visible. Check the progress bar and 100% mark.

fix(osd): 加快 Super+P 切换显示模式时的勾选更新

1. 移除 OSD 固定的 100 ms 延时,收到请求后立即派发。
2. 首次打开读取显示状态,连按时用缓存列表推进勾选,
   停按两秒后应用最后选中的模式。
3. 候选列表读取失败时重试,当前模式或主屏未知时从首项开始轮选。
4. 根据音量和静音通知补刷音量 OSD,默认输出切换时同时刷新
   音量、静音和音量增强设置。

Influence:
1. 首按 Super+P,确认面板勾选当前模式。
2. 按住 Super 连按 P,确认勾选逐次推进,停按两秒只应用最后一项。
3. 验证候选列表或实际模式读取失败后仍能恢复轮选。
4. 验证音量从零回升、静音和面板可见时切换默认输出,
   检查进度条和 100% 刻度是否正确。

Log: 加快 Super+P 勾选更新,并在音量状态变化后补刷面板
PMS: BUG-383567
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, 52cyb

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

@52cyb

52cyb commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot
deepin-bot Bot merged commit 99a37db into linuxdeepin:master Nov 30, 2026
9 of 13 checks passed
@deepin-bot

deepin-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked, merge_method: rebase)

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