1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00

WindowServer: Support desktop wallpapers.

For now, you don't get to choose the wallpaper, but it's still pretty cool.
This commit is contained in:
Andreas Kling 2019-02-08 08:45:59 +01:00
parent 2736957701
commit 90d3375dc2
5 changed files with 230 additions and 3 deletions

View file

@ -426,12 +426,18 @@ void WSWindowManager::compose()
return false;
};
if (!m_wallpaper)
m_wallpaper = GraphicsBitmap::load_from_file("/res/wallpapers/gray-wood.rgb", { 1024, 768 });
for (auto& dirty_rect : dirty_rects) {
if (any_window_contains_rect(dirty_rect)) {
continue;
}
//dbgprintf("Repaint root %d,%d %dx%d\n", dirty_rect.x(), dirty_rect.y(), dirty_rect.width(), dirty_rect.height());
m_back_painter->fill_rect(dirty_rect, m_background_color);
if (!m_wallpaper)
m_back_painter->fill_rect(dirty_rect, m_background_color);
else
m_back_painter->blit(dirty_rect.location(), *m_wallpaper, dirty_rect);
}
for (auto* window = m_windows_in_order.head(); window; window = window->next()) {
WSWindowLocker locker(*window);