From a60debe7bbb50ab0cf38dfb6ba0e070b9a7c719b Mon Sep 17 00:00:00 2001 From: Rocco Corsi <5201151+rcorsi@users.noreply.github.com> Date: Sat, 16 Aug 2025 17:57:35 -0400 Subject: [PATCH] LibWeb: Don't always stop drawing scrollbar on mouseleave PaintableBox::handle_mouseleave is turning off scrollbar updating, but the user might still have the primary button down to scroll. Don't turn it off if grabbing the thumb to scroll. Resolves crashing on MacOSX AppKit and Qt where gutter_size is 0 when mouse is moved outside window. --- Libraries/LibWeb/Painting/PaintableBox.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Libraries/LibWeb/Painting/PaintableBox.cpp b/Libraries/LibWeb/Painting/PaintableBox.cpp index 08d05645935..3fd09e3d9e0 100644 --- a/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -1049,6 +1049,11 @@ Paintable::DispatchEventOfSameName PaintableBox::handle_mousemove(Badge) { + // FIXME: early return needed as MacOSX calls this even when user is pressing mouse button + // https://github.com/LadybirdBrowser/ladybird/issues/5844 + if (m_scroll_thumb_dragging_direction.has_value()) + return; + auto previous_draw_enlarged_horizontal_scrollbar = m_draw_enlarged_horizontal_scrollbar; m_draw_enlarged_horizontal_scrollbar = false; if (previous_draw_enlarged_horizontal_scrollbar != m_draw_enlarged_horizontal_scrollbar)