SUMMARY If "Remember previous status" option is checked, the state of the Bluetooth adapter is not restored after logout/login. Most likely, the problem is that saveState () is only called on shutdown and sleep, but not on logout. STEPS TO REPRODUCE 1. Open Bluetooth settings (System Settings > Bluetooth > Settings) 2. Select "Remember previous status" option 3. Disable Bluetooth adapter 4. Logout and login OBSERVED RESULT Bluetooth adapter in enabled. EXPECTED RESULT Bluetooth adapter in disabled. SOFTWARE/OS VERSIONS Operating System: KDE neon Unstable Edition KDE Plasma Version: 5.23.80 KDE Frameworks Version: 5.88.0 Qt Version: 5.15.3 Graphics Platform: X11
Confirmed. The problem is that saveState() is only called on shutdown and sleep, but not on logout. We accomplish this by connecting to the "PrepareForShutdown" and "PrepareForSleep" methods, but there's nothing about logout that I can see. Still investigating.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/bluedevil/-/merge_requests/54
Git commit e57bb7580251f38e798bea21cdad43a3f90f2568 by Nate Graham. Committed on 03/12/2021 at 16:23. Pushed by ngraham into branch 'master'. Save bluetooth status on teardown Instead of watching for the shutdown and restart signals, just save status anytime kded quits, which automatically covers those use cases as well as when logging out. This is what the code was already halfway doing; let's go all the way. FIXED-IN: 5.23.5 M +3 -26 src/kded/devicemonitor.cpp M +0 -1 src/kded/devicemonitor.h https://invent.kde.org/plasma/bluedevil/commit/e57bb7580251f38e798bea21cdad43a3f90f2568
Git commit daaa18920ae93b482585eb3df790a6d5a647b6db by Nate Graham. Committed on 03/12/2021 at 16:32. Pushed by ngraham into branch 'Plasma/5.23'. Save bluetooth status on teardown Instead of watching for the shutdown and restart signals, just save status anytime kded quits, which automatically covers those use cases as well as when logging out. This is what the code was already halfway doing; let's go all the way. FIXED-IN: 5.23.5 (cherry picked from commit e57bb7580251f38e798bea21cdad43a3f90f2568) M +3 -26 src/kded/devicemonitor.cpp M +0 -1 src/kded/devicemonitor.h https://invent.kde.org/plasma/bluedevil/commit/daaa18920ae93b482585eb3df790a6d5a647b6db
Just checked and it's still not fixed. The ~/.config/bluedevilglobalrc file is still empty. SOFTWARE/OS VERSIONS Operating System: KDE neon Unstable Edition KDE Plasma Version: 5.23.80 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.3 Graphics Platform: X11
Well I don't know then. :(
Does it work for you?
Yes.
In my case, the destructor of the BlueDevilDaemon is not called, so the saveState is not called either. Does BlueDevil get killed on logout?
Yes, sometimes that can happen. I see this with other apps too; they act like they killed or were crashed when logging out. I would suggest that the code here is working, but there is an issue in Plasma or ksmserver. Can you file a new bug report for that?
Created attachment 145164 [details] Patch What about something like this? > Can you file a new bug report for that? I think you describe this issue better.
Sure, go ahead and submit that patch and let's see what comes out of it. I can see the value because it can be desirable to save incrementally so we don't lose state when there's a crash.
I found that it works well if I manually kill the plasma_session process. Also, I have [startplasma-x11: Could not fully finish the process "/usr/bin/plasma_session"] message in the journalctl on logout. Is this all somehow related?
That does seem related, yeah. A