1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

WindowServer+Taskbar: Send WM icon updates as Gfx::ShareableBitmap

Window icons in Taskbar were previously received in WM events with
shbuf ID's. Now that Gfx::ShareableBitmap is backed by anonymous files,
we can easily switch to using those.
This commit is contained in:
Andreas Kling 2021-01-15 23:13:24 +01:00
parent 633915e792
commit 333366a99d
9 changed files with 17 additions and 35 deletions

View file

@ -60,7 +60,7 @@ bool decode(Decoder& decoder, Gfx::ShareableBitmap& shareable_bitmap)
if (!decoder.decode(size))
return false;
auto bitmap = Gfx::Bitmap::create_with_anon_fd(Gfx::BitmapFormat::RGBA32, anon_file.fd(), size, Gfx::Bitmap::ShouldCloseAnonymousFile::No);
auto bitmap = Gfx::Bitmap::create_with_anon_fd(Gfx::BitmapFormat::RGBA32, anon_file.take_fd(), size, Gfx::Bitmap::ShouldCloseAnonymousFile::Yes);
shareable_bitmap = bitmap->to_shareable_bitmap();
return true;
}