diff options
author | Tom <tomut@yahoo.com> | 2021-02-14 16:42:37 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-15 23:07:49 +0100 |
commit | d590e0c946c0c54b30b280987c18a20d60d4195c (patch) | |
tree | e83bddec5c8feb4a42fca99713dca02b2c5afc0b /Userland/Libraries/LibGfx | |
parent | b3f0a5c917a69eaf8a405653ae882f45a03ad467 (diff) | |
download | serenity-d590e0c946c0c54b30b280987c18a20d60d4195c.zip |
WindowServer: Add support for alpha channel based hit testing
This enables implementing non-rectangular window shapes, including
non-rectangular window frames.
Diffstat (limited to 'Userland/Libraries/LibGfx')
-rw-r--r-- | Userland/Libraries/LibGfx/ClassicWindowTheme.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibGfx/WindowTheme.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/ClassicWindowTheme.h b/Userland/Libraries/LibGfx/ClassicWindowTheme.h index 165997bfa4..b0f2c86136 100644 --- a/Userland/Libraries/LibGfx/ClassicWindowTheme.h +++ b/Userland/Libraries/LibGfx/ClassicWindowTheme.h @@ -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 { diff --git a/Userland/Libraries/LibGfx/WindowTheme.h b/Userland/Libraries/LibGfx/WindowTheme.h index 383eadcca3..7a18a0b422 100644 --- a/Userland/Libraries/LibGfx/WindowTheme.h +++ b/Userland/Libraries/LibGfx/WindowTheme.h @@ -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() { } |