mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 20:32:56 +03:00
WindowServer: Clear wallpaper if the requested path is empty
235f39e449
secretly added an if check that ignores all the files that
couldn't be loaded into bitmaps. Unfortunately, we send an empty path
as a way to unset the wallpaper, which meant that we couldn't go back
to the default background color anymore.
This commit is contained in:
parent
bffdc056a2
commit
65f3a259d2
Notes:
sideshowbarker
2024-07-18 00:39:49 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/65f3a259d28 Pull-request: https://github.com/SerenityOS/serenity/pull/11001
@ -813,12 +813,15 @@ bool Compositor::set_wallpaper(const String& path, Function<void(bool)>&& callba
|
||||
},
|
||||
|
||||
[this, path, callback = move(callback)](ErrorOr<NonnullRefPtr<Gfx::Bitmap>> bitmap) {
|
||||
if (bitmap.is_error()) {
|
||||
if (bitmap.is_error() && !path.is_empty()) {
|
||||
callback(false);
|
||||
return;
|
||||
}
|
||||
m_wallpaper_path = path;
|
||||
m_wallpaper = bitmap.release_value();
|
||||
if (bitmap.is_error())
|
||||
m_wallpaper = nullptr;
|
||||
else
|
||||
m_wallpaper = bitmap.release_value();
|
||||
invalidate_screen();
|
||||
callback(true);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user