Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2707,8 +2707,22 @@ public void mouseWheelMoved( MouseWheelEvent e ) {

// because this listener receives mouse events for the whole tabbed pane,
// we have to check whether the mouse is located over the viewport
if( !isInViewport( e.getX(), e.getY() ) )
if( !isInViewport( e.getX(), e.getY() ) ) {
// if it is not in the viewport, retarget the even to a parent container
// which might support scrolling (e.g. a surrounding ScrollPane)
Container parent = getParent();
while (parent != null) {
// informing the first parent with a mouse wheel listener should be sufficient.
if (parent.getMouseWheelListeners().length > 0) {
for (MouseWheelListener parentListener : parent.getMouseWheelListeners()) {
parentListener.mouseWheelMoved(e);
}
return;
}
parent = parent.getContainer();
}
return;
}

lastMouseX = e.getX();
lastMouseY = e.getY();
Expand Down