1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

WindowServer+Userland: Pass wallpapers as Gfx::Bitmap instead of path

The WindowServer _really_ does not need to know the filesystem path to
it's wallpaper, and allows setting arbitrary wallpapers (those outside
of `/res/wallpapers`).

The GUI::Desktop will keep track of the path to the wallpaper (if any),
and save it to config if desired (to be persisted).

This avoids the need to `unveil` paths to the wallpaper, fixing #11158
This commit is contained in:
James Puleo 2022-02-13 13:00:57 -05:00 committed by Ali Mohammad Pur
parent f538545987
commit a0e7a4b9a8
13 changed files with 61 additions and 58 deletions

View file

@ -29,8 +29,9 @@ public:
void set_wallpaper_mode(StringView mode);
String wallpaper() const;
bool set_wallpaper(StringView path, bool save_config = true);
String wallpaper_path() const;
RefPtr<Gfx::Bitmap> wallpaper_bitmap() const;
bool set_wallpaper(RefPtr<Gfx::Bitmap> wallpaper_bitmap, Optional<String> path);
Gfx::IntRect rect() const { return m_bounding_rect; }
const Vector<Gfx::IntRect, 4>& rects() const { return m_rects; }
@ -56,6 +57,7 @@ private:
unsigned m_workspace_rows { 1 };
unsigned m_workspace_columns { 1 };
Vector<Function<void(Desktop&)>> m_receive_rects_callbacks;
bool m_is_setting_desktop_wallpaper { false };
};
}