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

WindowServer: Improvements to support alpha channel in window frames

This fixes some issues handling the alpha channel that may be present
in rendered window frames.

Fixes #5303
This commit is contained in:
Tom 2021-02-12 14:25:08 -07:00 committed by Andreas Kling
parent 9ae02d4c92
commit 0138f13bfe
6 changed files with 55 additions and 20 deletions

View file

@ -48,6 +48,10 @@ public:
virtual Vector<IntRect> layout_buttons(WindowType, const IntRect& window_rect, const Palette&, size_t buttons) const override;
virtual bool is_simple_rect_frame() const override { return true; }
virtual bool frame_uses_alpha(WindowState state, const Palette& palette) const override
{
return compute_frame_colors(state, palette).uses_alpha();
}
private:
struct FrameColors {
@ -56,6 +60,11 @@ private:
Color border_color2;
Color title_stripes_color;
Color title_shadow_color;
bool uses_alpha() const
{
return title_color.alpha() != 0xff || border_color.alpha() != 0xff || border_color2.alpha() != 0xff || title_stripes_color.alpha() != 0xff || title_shadow_color.alpha() != 0xff;
}
};
FrameColors compute_frame_colors(WindowState, const Palette&) const;