mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:17:45 +00:00
DisplaySettings: Lazily load wallpapers
Load the wallpaper in a background action instead of on the main thread. This reduces the time to first paint, and makes the UI feel more responsive when clicking on wallpaper thumbnails. The behavior of the method is changed slightly to return true if it succesfully "loads" the empty path. This makes the API a little more consistent, where "true" means "I made changes" and "false" means "I did not make changes". No call sites currently use the return value, so no changes are needed to those.
This commit is contained in:
parent
ac055554f6
commit
1474a537b6
2 changed files with 31 additions and 13 deletions
|
@ -47,6 +47,11 @@ private:
|
|||
Gfx::IntSize m_desktop_resolution;
|
||||
int m_desktop_scale_factor { 1 };
|
||||
Gfx::Color m_desktop_color;
|
||||
|
||||
bool is_different_to_current_wallpaper_path(String const& path)
|
||||
{
|
||||
return (!path.is_empty() && path != m_desktop_wallpaper_path) || (path.is_empty() && m_desktop_wallpaper_path != nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue