mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibGUI: Save current wallpaper setting to WindowManager.ini.
This commit is contained in:
parent
c5edc09b78
commit
9dfe6521fc
Notes:
sideshowbarker
2024-07-19 09:41:50 +09:00
Author: https://github.com/asliturk Commit: https://github.com/SerenityOS/serenity/commit/9dfe6521fcb Pull-request: https://github.com/SerenityOS/serenity/pull/1152
1 changed files with 12 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <LibCore/CConfigFile.h>
|
||||
#include <LibGUI/GDesktop.h>
|
||||
#include <LibGUI/GWindowServerConnection.h>
|
||||
#include <string.h>
|
||||
|
@ -53,7 +54,17 @@ void GDesktop::did_receive_screen_rect(Badge<GWindowServerConnection>, const Rec
|
|||
bool GDesktop::set_wallpaper(const StringView& path)
|
||||
{
|
||||
GWindowServerConnection::the().post_message(WindowServer::AsyncSetWallpaper(path));
|
||||
return GWindowServerConnection::the().wait_for_specific_message<WindowClient::AsyncSetWallpaperFinished>()->success();
|
||||
auto ret_val = GWindowServerConnection::the().wait_for_specific_message<WindowClient::AsyncSetWallpaperFinished>()->success();
|
||||
|
||||
if (ret_val) {
|
||||
dbg() << "Saving wallpaper path '" << path << "' to config file at " << config->file_name();
|
||||
|
||||
RefPtr<CConfigFile> config = CConfigFile::get_for_app("WindowManager");
|
||||
config->write_entry("Background", "Wallpaper", path);
|
||||
config->sync();
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
String GDesktop::wallpaper() const
|
||||
|
|
Loading…
Add table
Reference in a new issue