From e6e2d414da15db6cbe8011136ea35d5bae0bcdea Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sat, 10 Jun 2017 08:39:38 -0400 Subject: Fix up the audio volume reset on login into Lumina. It looks like the OS-specific functionality to save/restore the last audio setting is borked, so I bypassed it with a lumina-specific "session state" value in the user's settings file. --- src-qt5/core/lumina-desktop/LSession.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src-qt5') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 502cc867..97f74e66 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -188,7 +188,8 @@ void LSession::CleanupSession(){ //Create a temporary flag to prevent crash dialogs from opening during cleanup LUtils::writeFile("/tmp/.luminastopping",QStringList() << "yes", true); //Start the logout chimes (if necessary) - LOS::setAudioVolume( LOS::audioVolume() ); //make sure the audio volume is saved in the backend for the next login + int vol = LOS::audioVolume(); + if(vol>=0){ sessionsettings->setValue("last_session_state/audio_volume", vol); } bool playaudio = sessionsettings->value("PlayLogoutAudio",true).toBool(); if( playaudio ){ playAudioFile(LOS::LuminaShare()+"Logout.ogg"); } //Stop the background system tray (detaching/closing apps as necessary) @@ -289,7 +290,7 @@ void LSession::launchStartupApps(){ //Re-load the screen brightness and volume settings from the previous session // Wait until after the XDG-autostart functions, since the audio system might be started that way qDebug() << " - Loading previous settings"; - tmp = LOS::audioVolume(); + tmp = sessionsettings->value("last_session_state/audio_volume",50).toInt(); if(tmp>=0){ LOS::setAudioVolume(tmp); } qDebug() << " - - Audio Volume:" << QString::number(tmp)+"%"; -- cgit