diff --git a/src/window.cpp b/src/window.cpp --- a/src/window.cpp +++ b/src/window.cpp @@ -502,7 +502,7 @@ static void DispatchMouseWheelEvent(Wind } /* Scroll the widget attached to the scrollbar. */ - Scrollbar *sb = nwid->FindScrollbar(w); + Scrollbar *sb = (nwid->scrollbar_index >= 0 ? w->GetScrollbar(nwid->scrollbar_index) : NULL); if (sb != NULL && sb->GetCount() > sb->GetCapacity()) { sb->UpdatePosition(wheel); w->SetDirty();