While dragging the knob of a scrollbar, we sometimes lose the mouseup event. This leaves us scrolling while mouse button is released, which is not great. When you then start dragging the scrollbar again, the program crashes due to VERIFY(!m_dragging);
in Slider::start_drag
.
When investigating, I found that in Window::handle_mouse_event
we reset the automatic cursor tracking widget when we receive a mouse events without buttons held. This sounds correct, but from time to time such an event arrives even as I'm still holding the mouse button down. If at that point the cursor is outside of the widget, the drag state is corrupted, and the bug appears. Note that it can be hard to trigger it consistently.
Now, why do we receive a mouse event with incorrect button presses like this? It is because we are sending fake mouse move events in WindowManager::reevaluate_hover_state_for_window
with buttons: 0
in order to trigger hovering. It is unclear to me what is the best way of fixing this bug, some options being:
Advice would be appreciated :)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too