From 094b47971b79035b703e43a573fb3073b25ab311 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 8 Jan 2021 23:50:03 +0100 Subject: [PATCH] LibGUI: Make Widget::HitTestResult::widget a WeakPtr --- Libraries/LibGUI/Widget.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Libraries/LibGUI/Widget.h b/Libraries/LibGUI/Widget.h index 2cb93bb798f..22b3a487c87 100644 --- a/Libraries/LibGUI/Widget.h +++ b/Libraries/LibGUI/Widget.h @@ -184,10 +184,12 @@ public: void set_focus_policy(FocusPolicy policy); FocusPolicy focus_policy() const; - enum class ShouldRespectGreediness { No = 0, - Yes }; + enum class ShouldRespectGreediness { + No = 0, + Yes + }; struct HitTestResult { - Widget* widget { nullptr }; + WeakPtr widget; Gfx::IntPoint local_position; }; HitTestResult hit_test(const Gfx::IntPoint&, ShouldRespectGreediness = ShouldRespectGreediness::Yes);