mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +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:
parent
2736957701
commit
90d3375dc2
5 changed files with 230 additions and 3 deletions
214
Base/res/wallpapers/gray-wood.rgb
Normal file
214
Base/res/wallpapers/gray-wood.rgb
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1,9 +1,15 @@
|
|||
rm -vf _fs_contents.lock
|
||||
rm -vf _fs_contents
|
||||
cp -vp _fs_contents.stock _fs_contents
|
||||
dd if=/dev/zero of=_fs_contents bs=1M count=8
|
||||
mke2fs _fs_contents
|
||||
chown 1000:1000 _fs_contents
|
||||
mkdir -vp mnt
|
||||
mount -o loop _fs_contents mnt/
|
||||
mkdir -vp mnt/bin
|
||||
mkdir -vp mnt/etc
|
||||
mkdir -vp mnt/proc
|
||||
mkdir -vp mnt/dev
|
||||
mkdir -vp mnt/dev/pts
|
||||
mknod mnt/dev/tty0 c 4 0
|
||||
mknod mnt/dev/tty1 c 4 1
|
||||
mknod mnt/dev/tty2 c 4 2
|
||||
|
@ -11,7 +17,6 @@ mknod mnt/dev/tty3 c 4 3
|
|||
mknod mnt/dev/keyboard c 85 1
|
||||
mknod mnt/dev/psaux c 10 1
|
||||
mknod mnt/dev/ptmx c 5 2
|
||||
mkdir mnt/dev/pts
|
||||
mknod mnt/dev/gui_events c 66 1
|
||||
ln -s /proc/self/fd/0 mnt/dev/stdin
|
||||
ln -s /proc/self/fd/1 mnt/dev/stdout
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -105,6 +105,8 @@ private:
|
|||
|
||||
RetainPtr<Font> m_font;
|
||||
|
||||
RetainPtr<GraphicsBitmap> m_wallpaper;
|
||||
|
||||
mutable Lock m_lock;
|
||||
|
||||
bool m_flash_flush { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue