fix(wallpaper): preserve automation schedule across config reloads

This commit is contained in:
Ly-sec
2026-05-06 09:56:55 +02:00
parent d7d8f5a0eb
commit 8f7e5853e0
2 changed files with 11 additions and 1 deletions
+10 -1
View File
@@ -217,6 +217,7 @@ bool Wallpaper::initialize(WaylandConnection& wayland, ConfigService* config, Re
m_textureCache = textureCache;
if (!m_config->config().wallpaper.enabled) {
m_wallpaperEnabled = false;
kLog.info("disabled in config");
return true;
}
@@ -232,6 +233,7 @@ bool Wallpaper::initialize(WaylandConnection& wayland, ConfigService* config, Re
});
resetAutomationState();
m_wallpaperEnabled = true;
syncInstances();
return true;
}
@@ -239,10 +241,12 @@ bool Wallpaper::initialize(WaylandConnection& wayland, ConfigService* config, Re
void Wallpaper::reload() {
kLog.info("reloading config");
const bool wasEnabled = m_wallpaperEnabled;
const bool nowEnabled = m_config->config().wallpaper.enabled;
resetAutomationState();
if (!nowEnabled) {
resetAutomationState();
m_wallpaperEnabled = false;
// Wallpaper disabled — full teardown
for (auto& inst : m_instances) {
releaseInstanceTextures(*inst);
@@ -251,6 +255,11 @@ void Wallpaper::reload() {
return;
}
if (!wasEnabled) {
resetAutomationState();
}
m_wallpaperEnabled = true;
// Wallpaper remains (or becomes) enabled — sync instances without teardown
// to avoid flickering. syncInstances handles monitor override changes
// (adds/removes instances) without disturbing existing surfaces.
+1
View File
@@ -45,6 +45,7 @@ private:
ConfigService* m_config = nullptr;
RenderContext* m_renderContext = nullptr;
SharedTextureCache* m_textureCache = nullptr;
bool m_wallpaperEnabled = false;
std::int64_t m_lastAutomationMinuteStamp = -1;
std::int64_t m_lastAutomationSwitchMinute = -1;
Signal<>::ScopedConnection m_paletteConn;