Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work! UwU #1110

Closed
MikuChan03 opened this issue Oct 11, 2019 · 5 comments
Closed

Doesn't work! UwU #1110

MikuChan03 opened this issue Oct 11, 2019 · 5 comments
Labels
bug

Comments

@MikuChan03
Copy link

@MikuChan03 MikuChan03 commented Oct 11, 2019

Hi~~
So Senpai, thewe is this issue I've been having in blueman-manager.
I have 2 bluetooth adaptows and when I switch between them, the 3 bars that tell the signal stwength fow cuwwently connected devices disappear (;⌣̀_⌣́)

Don't wowwy though, I got it all mapped out! 🎶🎶💕

It's like this, some senpai wwote the function
set_adapter in gui/DeviceList.py, which in some cases does

self.emit("adapter-changed", self.__adapter_path)

twice! One such case is when simply changing an adaptor.

main/Manager.py wesponds to this signal by calling display_known_devices in gui/DeviceList.py, twice! add_device in gui/DeviceList.py is then called twice too, which then calls the sauce of the pwoblem, monitor_power_levels in gui/DeviceList.py.
monitor_power_levels checks the super fast cache that is self.monitored_devices before deciding on whether to start a timer to monitor the signal strength ot the device. This timer is passed a refewence to the Gtk.TreeRowReference that is the row with the connected device.
So monitor_power_levels runs for the first time and the timer is set up alwight, but it's one whole second long! Before that second elapses, the second invocation of display_known_devices sets up everything all over again and removes the Gtk.TreeRowReference that the first timer uses. However, when reaching monitor_power_levels for the second time, the device doesn't get handled, because it's already in the self.monitored_devices cache and no second timer is set up. So when one second finally does elapse, the first timer goes:

if not row_ref.valid():

So the first timer gets removed and we never get to know how stwong the signal actually is, because there is no timer that cares for it because of the cache. The super fast self.monitored_devices cache pwevents display_known_devices from being idempotent!!! You senpais can either wemove the cache or make sure to call display_known_devices only once, but as it stands, once we change between two adapters, we can't see which device is actually connected and how strong that connection is!!!!!!!!

That is all I wanted to so, I hope you can be so nice to
fixie wixie the pwoblem XD

starts twerking

@infirit

This comment has been minimized.

Copy link
Contributor

@infirit infirit commented Oct 11, 2019

Thanks, see #1111 and #1112

@infirit infirit added the bug label Oct 11, 2019
@infirit

This comment has been minimized.

Copy link
Contributor

@infirit infirit commented Oct 13, 2019

Merged the fixed, closing.

@infirit infirit closed this Oct 13, 2019
@KrzysztofSzewczyk

This comment has been minimized.

Copy link

@KrzysztofSzewczyk KrzysztofSzewczyk commented Oct 26, 2019

What in the name of God

@infirit

This comment has been minimized.

Copy link
Contributor

@infirit infirit commented Oct 27, 2019

@KrzysztofSzewczyk you seem confused, let me help you.

@MikuChan03 identified an issue with signal bars when switching adapters. Next found the cause of the signal bars disappearing and pointed where to look. So thanks to @MikuChan03 I was able to quickly find the bug and fix it. I'm sure you see why I appreciate the contribution and we should thank @MikuChan03!

@blueman-project blueman-project deleted a comment from SoKamil Oct 28, 2019
@sparskakyl

This comment has been minimized.

Copy link

@sparskakyl sparskakyl commented Dec 22, 2019

Bruh momentos numero dos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.