From 65f3a259d2801a848bc2dacd1f15d7c26c1a65fc Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sun, 21 Nov 2021 18:51:39 +0100 Subject: [PATCH] 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. --- Userland/Services/WindowServer/Compositor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Userland/Services/WindowServer/Compositor.cpp b/Userland/Services/WindowServer/Compositor.cpp index f1b65b4a80..68cff53096 100644 --- a/Userland/Services/WindowServer/Compositor.cpp +++ b/Userland/Services/WindowServer/Compositor.cpp @@ -813,12 +813,15 @@ bool Compositor::set_wallpaper(const String& path, Function&& callba }, [this, path, callback = move(callback)](ErrorOr> 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); });