mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
WindowServer: Reuse config variable from the class on theme change
When changing the theme, there were two Core::ConfigFile instances (one class scoped -- m_config and one function scoped -- wm_config) fighting over the file, resulting in not saving the new theme name to the config. :^( This makes WindowServer remember selected theme from the menu after reboot!
This commit is contained in:
parent
d804ce830d
commit
f2c9ef3763
1 changed files with 3 additions and 4 deletions
|
@ -1955,10 +1955,9 @@ bool WindowManager::update_theme(String theme_path, String theme_name)
|
||||||
return false;
|
return false;
|
||||||
Gfx::set_system_theme(new_theme);
|
Gfx::set_system_theme(new_theme);
|
||||||
m_palette = Gfx::PaletteImpl::create_with_anonymous_buffer(new_theme);
|
m_palette = Gfx::PaletteImpl::create_with_anonymous_buffer(new_theme);
|
||||||
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini");
|
m_config->write_entry("Theme", "Name", theme_name);
|
||||||
wm_config->write_entry("Theme", "Name", theme_name);
|
m_config->remove_entry("Background", "Color");
|
||||||
wm_config->remove_entry("Background", "Color");
|
m_config->sync();
|
||||||
wm_config->sync();
|
|
||||||
invalidate_after_theme_or_font_change();
|
invalidate_after_theme_or_font_change();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue