Skip to content

feat(media): add media volume osd with media player name - #3835

Draft
AdityaKr015 wants to merge 5 commits into
noctalia-dev:mainfrom
AdityaKr015:feat/media-osd
Draft

feat(media): add media volume osd with media player name#3835
AdityaKr015 wants to merge 5 commits into
noctalia-dev:mainfrom
AdityaKr015:feat/media-osd

Conversation

@AdityaKr015

Copy link
Copy Markdown
Contributor

Summary

This PR shows OSD when media volume is changed with playerctl, with MPRIS supported Media Player Name with disc-filled icon.

Motivation

For the people who wants OSD when changing media volume.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Related Issue

Closes #3791

Testing

  • Ran just format,`meson compile -C build-debug no issue.
  • Ran meson test -C build-debug all 72 tests passed.
  • Then just lint all clear no errors.
  • Killed the current running noctalia pkill noctalia then started new feature one ./build-debug/noctalia
  • Then tested manually using playerctl cmd using VLC, Celluloid, Dragon Player, Elisa

Manual Coverage

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

Screenshots / Videos

image image image image

I have tested with celluloid, elisa, dragon player. All of them works, just did took screenshot for them

Checklist

  • This PR is ready for review
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed
  • I ran the relevant build or test commands
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation after merge, or this PR does not change user-facing configuration or behavior.
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

@AdityaKr015 AdityaKr015 changed the title feat(media):Media Volume OSD feat(media): add media volume osd with media player name Aug 7, 2026
@ItsLemmy

Copy link
Copy Markdown
Collaborator

[P2] Preserve the debounce window for trailing property refreshes — src/dbus/mpris/mpris_service.cpp:1658-1667

DeferredCall::callLater() runs at the next main-loop iteration, not after the remaining 120 ms debounce interval. The
callback also removes busName from m_pendingPropertiesRefresh before dispatching addOrRefreshPlayer().

Consequently, a player emitting PropertiesChanged every 16 ms can still trigger a two-interface GetAll refresh on every loop iteration; the existing debounce is effectively bypassed. Schedule one trailing refresh for the end of
kPropertiesDebounceWindow, keeping it pending until that timer fires. A source-level simulation of 11 signals at 16 ms
intervals produced 11 refreshes rather than approximately two.

[P2] Reset the volume baseline when the active player changes — src/shell/osd/media_osd.cpp:55-56

m_lastVolumeis global to MediaOsd and is compared without checking activePlayer.busName. Active-player selection
itself invokes the MPRIS change callback. Switching from paused player A at 30% to paused player B at 80%, without
changing either volume, therefore sets trackChanged == false and volumeChanged == true, displaying a false “B — 80%” volume OSD. Track the baseline per bus name, or reseed m_lastVolume whenever the active bus name changes.

@ItsLemmy
ItsLemmy marked this pull request as draft August 17, 2026 01:33
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.

[FEATURE] Media Volume OSD

2 participants