Fix device list not being updated on selecting new bluetooth controller #3362
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.
I think I forgot two edge cases in my previous pull request that can both be triggered on a system with multiple bluetooth controllers present.
The first issue is that
bt->cur_controller_.has_value()
isn’t being checked inonObjectRemoved()
, which leads to a failed assertion if a bluetooth controller is removed from the system while no controller was currently displayed by waybar.The second issue is that the list of connected devices isn’t being updated when switching the displayed controller in
onObjectRemoved()
.Unfortunately due to a lack of multiple bluetooth controllers I can’t test if the bugs are actually triggerable or if this pull request fixes it. I’m quite confident in both, but I’ll try to get my hands on a usb bluetooth dongle next week in order to test it.