Ver Fonte

small fixes

UwU há 1 mês atrás
pai
commit
2558adbfbc

+ 5 - 0
src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.cpp

@@ -303,6 +303,11 @@ SDLAudioDriver::SDLAudioDriver (
 ) : AudioDriver (applicationContext, detector, recorder), m_audioSpec () {
     this->m_streamListMutex = SDL_CreateMutex ();
 
+    if (!applicationContext.settings.audio.enabled) {
+	sLog.out ("Audio is disabled, not opening any audio device");
+	return;
+    }
+
     if (SDL_InitSubSystem (SDL_INIT_AUDIO) < 0) {
 	sLog.error ("Cannot initialize SDL audio system, SDL_GetError: ", SDL_GetError ());
 	sLog.error ("Continuing without audio support");

+ 1 - 1
src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.h

@@ -78,7 +78,7 @@ public:
 private:
     SDL_mutex* m_streamListMutex;
     int m_lastStreamID = 0;
-    SDL_AudioDeviceID m_deviceID;
+    SDL_AudioDeviceID m_deviceID = 0;
     bool m_initialized = false;
     SDL_AudioSpec m_audioSpec {};
     std::map<int, SDLAudioBuffer*> m_streams {};

+ 5 - 1
src/WallpaperEngine/Data/Parsers/ObjectParser.cpp

@@ -284,6 +284,10 @@ ObjectUniquePtr ObjectParser::parseObject (const JSON& it, const Project& projec
     const auto modelIt = it.find ("model");
     const auto shapeIt = it.find ("shape");
     const auto cameraIt = it.find ("camera");
+    const bool hasParticle = particleIt != it.end ()
+	&& (particleIt->is_object ()
+	    || (particleIt->is_string () && !particleIt->get<std::string> ().empty ()
+		&& particleIt->get<std::string> () != "None"));
     // anything but a JSON false leaves the object in the planar reflection (sub_14018FF60)
     const auto reflectedIt = it.find ("reflected");
     const bool reflected = reflectedIt == it.end () || !reflectedIt->is_boolean () || reflectedIt->get<bool> ();
@@ -348,7 +352,7 @@ ObjectUniquePtr ObjectParser::parseObject (const JSON& it, const Project& projec
 	return parseImage (it, project, std::move (basedata), *imageIt);
     } else if (soundIt != it.end () && !soundIt->is_null ()) {
 	return parseSound (it, project, std::move (basedata));
-    } else if (particleIt != it.end () && !particleIt->is_null ()) {
+    } else if (hasParticle) {
 	return parseParticle (it, project, std::move (basedata));
     } else if (textIt != it.end () && !textIt->is_null ()) {
 	return parseText (it, project, std::move (basedata));

+ 5 - 5
tools/linuxvm/update_check.sh

@@ -114,18 +114,18 @@ fi
 # the app restarts after its own .deb update, a loaded guest takes a while before the debugging port answers again
 for _ in $(seq 30); do [ "$(cdp '1 + 1' 20)" = 2 ] && break; sleep 3; done
 # an app that restarts after its own update can drop the first call (empty answer), ask again
-for _ in 1 2 3; do
-    out=$(sshv ". ~/sessenv; cd ~/wem; timeout 400 python3 cdp.py 'window.electronAPI.lwe.installPrebuilt()' 2>&1 | cut -c1-300")
+for _ in 1 2; do
+    out=$(sshv ". ~/sessenv; cd ~/wem; timeout 30 python3 cdp.py 'window.electronAPI.lwe.installPrebuilt()' 2>&1 | cut -c1-300")
     [ -n "$out" ] && break
-    sleep 20
+    sleep 5
 done
 if echo "$out" | grep -q '"installed": true'; then pass "engine update installed through the prebuilt install: $(echo "$out" | grep -o '"version": "[^"]*"')"; else fail "engine update failed: $out"; fi
 
 # the .deb needs apt's --allow-downgrades to go back
 if echo "$out" | grep -q '"installed": true'; then
-    out=$(sshv ". ~/sessenv; cd ~/wem; timeout 400 python3 cdp.py \"window.electronAPI.lwe.installPrebuilt('$engine_old')\" 2>&1 | cut -c1-300")
+    out=$(sshv ". ~/sessenv; cd ~/wem; timeout 30 python3 cdp.py \"window.electronAPI.lwe.installPrebuilt('$engine_old')\" 2>&1 | cut -c1-300")
     echo "$out" | grep -q "\"version\": \"$engine_old\"" && pass "engine went back to $engine_old" || fail "engine downgrade to $engine_old: $out"
-    out=$(sshv ". ~/sessenv; cd ~/wem; timeout 400 python3 cdp.py \"window.electronAPI.lwe.installPrebuilt('libnode-arch')\" 2>&1 | cut -c1-300")
+    out=$(sshv ". ~/sessenv; cd ~/wem; timeout 30 python3 cdp.py \"window.electronAPI.lwe.installPrebuilt('libnode-arch')\" 2>&1 | cut -c1-300")
     echo "$out" | grep -q "\"version\": \"$engine_old\"" && pass "a non-version release is refused, the engine stays on $engine_old" || fail "libnode-arch changed the engine: $out"
 fi
 if [ "$kind" = deb ]; then