aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-06-10 08:39:38 -0400
committerKen Moore <ken@ixsystems.com>2017-06-10 08:39:38 -0400
commite6e2d414da15db6cbe8011136ea35d5bae0bcdea (patch)
tree892ca7246604618b1bcd5ea8e9301af0bd34dc01 /src-qt5
parentClean up some of the Lumina session init/cleanup. Trying to track down why th... (diff)
downloadlumina-e6e2d414da15db6cbe8011136ea35d5bae0bcdea.tar.gz
lumina-e6e2d414da15db6cbe8011136ea35d5bae0bcdea.tar.bz2
lumina-e6e2d414da15db6cbe8011136ea35d5bae0bcdea.zip
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.
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp5
1 files changed, 3 insertions, 2 deletions
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)+"%";
bgstack15