diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-21 18:59:07 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-21 20:15:51 +0200 |
commit | 59fd1f40cec8e4f4d3d0bed68f15e56f82cf08ae (patch) | |
tree | 44c157aa7adce078bd732fd7a6c18e80d5fe162d | |
parent | 8ac0d4abe19d6ad8428cea24ec22af5745c1161d (diff) | |
download | serenity-59fd1f40cec8e4f4d3d0bed68f15e56f82cf08ae.zip |
WindowServer: Store system font queries in WindowServer.ini :^)
Changes to the system font settings are now persisted in /etc.
Note that you still need to restart the system for changes to fully
apply in all programs.
-rw-r--r-- | Base/etc/WindowServer.ini | 4 | ||||
-rw-r--r-- | Userland/Services/WindowServer/ClientConnection.cpp | 4 | ||||
-rw-r--r-- | Userland/Services/WindowServer/main.cpp | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/Base/etc/WindowServer.ini b/Base/etc/WindowServer.ini index 0b74dad559..4c83ec6273 100644 --- a/Base/etc/WindowServer.ini +++ b/Base/etc/WindowServer.ini @@ -3,6 +3,10 @@ Width=1024 Height=768 ScaleFactor=1 +[Fonts] +Default=Katica 10 400 +FixedWidth=Csilla 10 400 + [Theme] Name=Default diff --git a/Userland/Services/WindowServer/ClientConnection.cpp b/Userland/Services/WindowServer/ClientConnection.cpp index 5fda635acb..7eaed9ead4 100644 --- a/Userland/Services/WindowServer/ClientConnection.cpp +++ b/Userland/Services/WindowServer/ClientConnection.cpp @@ -724,6 +724,10 @@ Messages::WindowServer::SetSystemFontsResponse ClientConnection::set_system_font }); WindowManager::the().invalidate_after_theme_or_font_change(); + + auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini"); + wm_config->write_entry("Fonts", "Default", default_font_query); + wm_config->write_entry("Fonts", "FixedWidth", fixed_width_font_query); return true; } diff --git a/Userland/Services/WindowServer/main.cpp b/Userland/Services/WindowServer/main.cpp index 8d61225218..df2e8dabc2 100644 --- a/Userland/Services/WindowServer/main.cpp +++ b/Userland/Services/WindowServer/main.cpp @@ -62,8 +62,11 @@ int main(int, char**) Gfx::set_system_theme(theme); auto palette = Gfx::PaletteImpl::create_with_anonymous_buffer(theme); - Gfx::FontDatabase::set_default_font_query("Katica 10 400"); - Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400"); + auto default_font_query = wm_config->read_entry("Fonts", "Default", "Katica 10 400"); + auto fixed_width_font_query = wm_config->read_entry("Fonts", "FixedWidth", "Csilla 10 400"); + + Gfx::FontDatabase::set_default_font_query(default_font_query); + Gfx::FontDatabase::set_fixed_width_font_query(fixed_width_font_query); WindowServer::EventLoop loop; |