feat(linux): Show all connected AirPods battery status in tray tooltip (#670)#676
Open
QuantumBreakz wants to merge 1 commit into
Open
Conversation
…ltip (librepods-org#670) - Add per-device registry (QList) to TrayIconManager keyed by bluetooth address - Implement updateDeviceBattery, updateDeviceName, setActiveDevice, removeDevice - Update tooltip rendering to show all connected devices (one per line, active device first) - Update main.cpp connection hooks to register and update device name and battery dynamically - Clean up device from tray registry on disconnect - Ignore anonymized BLE proximity broadcasts while an active AACP connection is running to prevent battery overwrite
Author
|
Hey @kavishdevar 👋 This PR addresses the multiple-device tray status issue #670. Could you please self-assign as reviewer/assignee when you have a moment? Since the PR is from a fork, GitHub restricts external permissions for setting these directly. Thanks! 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #670
When multiple AirPods are connected on Linux, the tray application would overwrite the tooltip with whichever device sent the latest update, meaning only one device status was visible.
This PR gives
TrayIconManagera per-device registry keyed by Bluetooth MAC address, showing all connected devices' battery states in a multi-line list on hover.Changes
1.
TrayIconManager(trayiconmanager.h/trayiconmanager.cpp)updateBatteryStatus(status)API with a per-device registry (QList<DeviceEntry>) keyed by Bluetooth address.updateDeviceBattery(key, name, status)– registers or updates a device.updateDeviceName(key, name)– refreshes a device's display label.setActiveDevice(key)– decides which device's battery drives the numerical percentage icon.removeDevice(key)– removes a device on disconnect.Battery Status: ...) so single-AirPod users notice no change.<name>: <status>), active device listed first.2.
main.cppWiringbatteryStatusChangedslot with a lambda using the new per-device API.deviceNameChangedto update the label in the registry when AACP metadata arrives.trayManager->removeDevice()instead of resetting the whole tray icon.3. BLE Override Guard
bleDeviceFoundto ignore BLE broadcasts when a live L2CAP/AACP connection is active.Constraints
Testing & Verification