1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:37:46 +00:00

WindowServer: Fix crash when hovering over title buttons

This fixes a crash where if you switched to a theme that has hover
icons for title buttons, then back to a theme that does not. Then
when you next hover over the title buttons the window server would
crash.

This was due to the hover_bitmap multi-scale bitmap pointer being
non-null, but not containing any bitmaps, so hitting an assertion
when painting.
This commit is contained in:
MacDue 2022-05-13 23:56:33 +01:00 committed by Andreas Kling
parent 74695ce76e
commit 857a767ab4
2 changed files with 2 additions and 1 deletions

View file

@ -24,6 +24,7 @@ public:
Gfx::BitmapFormat format() const { return m_format; }
bool load(StringView filename, StringView default_filename = {});
void add_bitmap(int scale_factor, NonnullRefPtr<Gfx::Bitmap>&&);
bool is_empty() const { return m_bitmaps.is_empty(); }
private:
MultiScaleBitmaps() = default;