Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 529377

Summary: [ScrolledComposite] does not scroll when mouse pointer is over inner scrolled composite with hidden scroll bar
Product: [Eclipse Project] Platform Reporter: Lucas Koehler <lkoehler>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eneufeld, ericwill, lkoehler
Version: 4.7.2Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
Eclipse project containing the example class and a target platform that uses the 4.7 update site none

Description Lucas Koehler CLA 2018-01-03 09:52:56 EST
Created attachment 272107 [details]
Eclipse project containing the example class and a target platform that uses the 4.7 update site

When using a ScrolledComposite that contains another ScrolledComposite within its content, the outer ScrolledComposite cannot be scrolled when the inner one has a hidden scroll bar and the mouse pointer is over the inner composite.

Example:
Outer ScrolledComposite A is configured for vertical scrolling and contains Composite B and ScrolledComposite C.
ScrolledComposite C is also configured for vertical scrolling.
In the application, A's scrollbar is shown and C's is hidden.
When I now try to scroll while the mouse cursor is over A, the scrolling does not work. When the cursor is over B or A's scroll bar, everything works as expected.

I tested this in a RCP application and small sample application in Oxygen.
Below you find the code of the sample application.
Alternatively, I attached a small sample project with a target definition that loads Eclipse RCP (and thereby SWT) from the Oxygen Update site.

The blue composite is the scroll composite with the hidden scroll bar.

I tested this on Ubuntu 17.04 and my GTK version is 3.22.11-0ubuntu3
I created the sample application after seeing Bug 474459. Maybe it's a related issue.



import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class ScrolledCompositeExample {
	public static void main(String[] args) {
		Display display = new Display();

		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());

		final ScrolledComposite scrollComposite = new ScrolledComposite(shell, SWT.V_SCROLL | SWT.BORDER);

		final Composite content = new Composite(scrollComposite, SWT.NONE);
		GridLayoutFactory.swtDefaults().numColumns(2).applyTo(content);

		Composite left = new Composite(content, SWT.BORDER);
		left.setSize(100, 100);
		left.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_GREEN));
		ScrolledComposite right = new ScrolledComposite(content, SWT.V_SCROLL | SWT.BORDER);
		right.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
		GridDataFactory.fillDefaults().grab(true, true).applyTo(right);
		right.setLayout(new FillLayout());

		scrollComposite.setContent(content);
		scrollComposite.setExpandVertical(true);
		scrollComposite.setExpandHorizontal(true);
		scrollComposite.setMinHeight(600);

		shell.setSize(400, 400);
		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}

}
Comment 1 Eric Williams CLA 2019-09-16 13:27:21 EDT
Reproducible using SWT master from today, GTK3.24.11, and X11.
Comment 2 Eclipse Genie CLA 2021-10-26 11:45:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.