diff options
author | Luke <luke.wilde@live.co.uk> | 2020-08-14 21:17:46 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-17 17:47:14 +0200 |
commit | c434a91c91fff5509fdb848ad567ba31988262c6 (patch) | |
tree | a01627606c3563e6e3a9cea6760f3f8ed5cf20f0 /Applications/FileManager/main.cpp | |
parent | 14a54a72faefab8f80f4dc3e60cd204ce56ad211 (diff) | |
download | serenity-c434a91c91fff5509fdb848ad567ba31988262c6.zip |
FileManager: Apply wallpaper on startup
I noticed that nothing actually applies the wallpaper on startup.
I wasn't sure where to put the responsibility, so I gave it to
the desktop mode file manager.
Also adds a save_config option to set_wallpaper so it doesn't
needlessly save the config.
Diffstat (limited to 'Applications/FileManager/main.cpp')
-rw-r--r-- | Applications/FileManager/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 2cdd992c13..11becb159c 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -40,6 +40,7 @@ #include <LibGUI/Application.h> #include <LibGUI/BoxLayout.h> #include <LibGUI/Clipboard.h> +#include <LibGUI/Desktop.h> #include <LibGUI/FileSystemModel.h> #include <LibGUI/InputBox.h> #include <LibGUI/Label.h> @@ -242,6 +243,12 @@ int run_in_desktop_mode(RefPtr<Core::ConfigFile> config, String initial_location desktop_view_context_menu->popup(event.screen_position()); }; + auto wm_config = Core::ConfigFile::get_for_app("WindowManager"); + auto selected_wallpaper = wm_config->read_entry("Background", "Wallpaper", ""); + if (!selected_wallpaper.is_empty()) { + GUI::Desktop::the().set_wallpaper(selected_wallpaper, false); + } + window->show(); return GUI::Application::the()->exec(); } |