diff --git a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp index 19d03773a0..bda2bdbf3e 100644 --- a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp @@ -22,6 +22,9 @@ #include #include +// Including this after to avoid LibIPC errors +#include + namespace DisplaySettings { BackgroundSettingsWidget::BackgroundSettingsWidget() @@ -86,9 +89,8 @@ void BackgroundSettingsWidget::create_frame() void BackgroundSettingsWidget::load_current_settings() { auto ws_config = Core::ConfigFile::open("/etc/WindowServer.ini"); - auto wm_config = Core::ConfigFile::open_for_app("WindowManager"); - auto selected_wallpaper = wm_config->read_entry("Background", "Wallpaper", ""); + auto selected_wallpaper = Config::read_string("WindowManager", "Background", "Wallpaper", ""); if (!selected_wallpaper.is_empty()) { auto index = static_cast(m_wallpaper_view->model())->index(selected_wallpaper, m_wallpaper_view->model_column()); m_wallpaper_view->set_cursor(index, GUI::AbstractView::SelectionUpdate::Set); @@ -118,8 +120,7 @@ void BackgroundSettingsWidget::load_current_settings() void BackgroundSettingsWidget::apply_settings() { - auto wm_config = Core::ConfigFile::open_for_app("WindowManager", Core::ConfigFile::AllowWriting::Yes); - wm_config->write_entry("Background", "Wallpaper", m_monitor_widget->wallpaper()); + Config::write_string("WindowManager", "Background", "Wallpaper", m_monitor_widget->wallpaper()); if (!m_monitor_widget->wallpaper().is_empty()) { GUI::Desktop::the().set_wallpaper(m_monitor_widget->wallpaper()); diff --git a/Userland/Applications/DisplaySettings/CMakeLists.txt b/Userland/Applications/DisplaySettings/CMakeLists.txt index 3950f15965..2ee90b2fb8 100644 --- a/Userland/Applications/DisplaySettings/CMakeLists.txt +++ b/Userland/Applications/DisplaySettings/CMakeLists.txt @@ -23,4 +23,4 @@ set(SOURCES ) serenity_app(DisplaySettings ICON app-display-settings) -target_link_libraries(DisplaySettings LibGUI) +target_link_libraries(DisplaySettings LibGUI LibConfig) diff --git a/Userland/Applications/DisplaySettings/main.cpp b/Userland/Applications/DisplaySettings/main.cpp index 6d154f423a..7b3917d9a4 100644 --- a/Userland/Applications/DisplaySettings/main.cpp +++ b/Userland/Applications/DisplaySettings/main.cpp @@ -9,6 +9,7 @@ #include "DesktopSettingsWidget.h" #include "FontSettingsWidget.h" #include "MonitorSettingsWidget.h" +#include #include #include #include @@ -28,6 +29,7 @@ int main(int argc, char** argv) } auto app = GUI::Application::construct(argc, argv); + Config::pledge_domains("WindowManager"); if (pledge("stdio thread recvfd sendfd rpath cpath wpath", nullptr) < 0) { perror("pledge");