From 207409c925d510cff602f72c692cddf89f2a00e3 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Sun, 2 Apr 2023 13:26:27 -0400 Subject: [PATCH] LibGUI: Don't hover AbstractView indicies outside visible content Fixes ComboBox ListView erroneously setting and scrolling to indicies just outside its inner rect when mousing along the bottom or top of the frame. --- Userland/Libraries/LibGUI/AbstractView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp index 26aa2320e39..cc78fb985b2 100644 --- a/Userland/Libraries/LibGUI/AbstractView.cpp +++ b/Userland/Libraries/LibGUI/AbstractView.cpp @@ -291,8 +291,10 @@ void AbstractView::mousemove_event(MouseEvent& event) if (!model()) return AbstractScrollableWidget::mousemove_event(event); - auto hovered_index = index_at_event_position(event.position()); - set_hovered_index(hovered_index); + if (widget_inner_rect().contains(event.position())) { + auto hovered_index = index_at_event_position(event.position()); + set_hovered_index(hovered_index); + } auto data_type = m_model->drag_data_type(); if (data_type.is_null())