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

WindowServer: Add WindowStack::window_at() and use it a bunch

This performs a hit test on the window stack to find the window under
a given cursor position.
This commit is contained in:
Andreas Kling 2021-06-18 01:03:15 +02:00
parent 4133caba78
commit f88361fc28
3 changed files with 27 additions and 21 deletions

View file

@ -20,6 +20,8 @@ public:
void remove(Window&);
void move_to_front(Window&);
Window* window_at(Gfx::IntPoint const&) const;
template<typename Callback>
IterationDecision for_each_visible_window_from_back_to_front(Callback);
template<typename Callback>
@ -44,6 +46,8 @@ public:
Window const* active_window() const { return m_active_window; }
void set_active_window(Window*);
Optional<HitTestResult> hit_test(Gfx::IntPoint const&) const;
private:
WeakPtr<Window> m_highlight_window;
WeakPtr<Window> m_active_window;