Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
5.81k stars 656 forks source link

Fix device list not being updated on selecting new bluetooth controller #3362

Closed lukasfink1 closed 2 weeks ago

lukasfink1 commented 2 weeks ago

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 in onObjectRemoved(), 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.