1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:17:36 +00:00

WindowServer: Add support for alpha channel based hit testing

This enables implementing non-rectangular window shapes, including
non-rectangular window frames.
This commit is contained in:
Tom 2021-02-14 16:42:37 -07:00 committed by Andreas Kling
parent b3f0a5c917
commit d590e0c946
12 changed files with 107 additions and 12 deletions

View file

@ -52,6 +52,7 @@ public:
{
return compute_frame_colors(state, palette).uses_alpha();
}
virtual float frame_alpha_hit_threshold(WindowState) const override { return 1.0f; }
private:
struct FrameColors {

View file

@ -63,6 +63,7 @@ public:
virtual Vector<IntRect> layout_buttons(WindowType, const IntRect& window_rect, const Palette&, size_t buttons) const = 0;
virtual bool is_simple_rect_frame() const = 0;
virtual bool frame_uses_alpha(WindowState, const Palette&) const = 0;
virtual float frame_alpha_hit_threshold(WindowState) const = 0;
protected:
WindowTheme() { }