|
@@ -139,12 +139,18 @@ void Compositor::compose()
|
|
return false;
|
|
return false;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ Color background_color = wm.palette().desktop_background();
|
|
|
|
+ String background_color_entry = wm.wm_config()->read_entry("Background", "Color", "");
|
|
|
|
+ if (!background_color_entry.is_empty()) {
|
|
|
|
+ background_color = Color::from_string(background_color_entry).value_or(background_color);
|
|
|
|
+ }
|
|
|
|
+
|
|
// Paint the wallpaper.
|
|
// Paint the wallpaper.
|
|
for (auto& dirty_rect : dirty_rects.rects()) {
|
|
for (auto& dirty_rect : dirty_rects.rects()) {
|
|
if (wm.any_opaque_window_contains_rect(dirty_rect))
|
|
if (wm.any_opaque_window_contains_rect(dirty_rect))
|
|
continue;
|
|
continue;
|
|
// FIXME: If the wallpaper is opaque, no need to fill with color!
|
|
// FIXME: If the wallpaper is opaque, no need to fill with color!
|
|
- m_back_painter->fill_rect(dirty_rect, wm.palette().desktop_background());
|
|
|
|
|
|
+ m_back_painter->fill_rect(dirty_rect, background_color);
|
|
if (m_wallpaper) {
|
|
if (m_wallpaper) {
|
|
if (m_wallpaper_mode == WallpaperMode::Simple) {
|
|
if (m_wallpaper_mode == WallpaperMode::Simple) {
|
|
m_back_painter->blit(dirty_rect.location(), *m_wallpaper, dirty_rect);
|
|
m_back_painter->blit(dirty_rect.location(), *m_wallpaper, dirty_rect);
|
|
@@ -325,6 +331,32 @@ void Compositor::invalidate(const Gfx::Rect& a_rect)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool Compositor::set_backgound_color(const String& background_color)
|
|
|
|
+{
|
|
|
|
+ auto& wm = WindowManager::the();
|
|
|
|
+ wm.wm_config()->write_entry("Background", "Color", background_color);
|
|
|
|
+ bool ret_val = wm.wm_config()->sync();
|
|
|
|
+
|
|
|
|
+ if (ret_val)
|
|
|
|
+ Compositor::invalidate();
|
|
|
|
+
|
|
|
|
+ return ret_val;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool Compositor::set_wallpaper_mode(const String& mode)
|
|
|
|
+{
|
|
|
|
+ auto& wm = WindowManager::the();
|
|
|
|
+ wm.wm_config()->write_entry("Background", "Mode", mode);
|
|
|
|
+ bool ret_val = wm.wm_config()->sync();
|
|
|
|
+
|
|
|
|
+ if (ret_val) {
|
|
|
|
+ m_wallpaper_mode = mode_to_enum(mode);
|
|
|
|
+ Compositor::invalidate();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ret_val;
|
|
|
|
+}
|
|
|
|
+
|
|
bool Compositor::set_wallpaper(const String& path, Function<void(bool)>&& callback)
|
|
bool Compositor::set_wallpaper(const String& path, Function<void(bool)>&& callback)
|
|
{
|
|
{
|
|
LibThread::BackgroundAction<RefPtr<Gfx::Bitmap>>::create(
|
|
LibThread::BackgroundAction<RefPtr<Gfx::Bitmap>>::create(
|