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

Bug 296074

Summary: [Widgets] Scrolling a Table w/USB mouse fails to trigger Scrollbar's SWT.Selection events (COCOA)
Product: [Eclipse Project] Platform Reporter: ArronM <arronm>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 3.6Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description ArronM CLA 2009-11-24 22:30:22 EST
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: SWT3621

If you have a table with a vertical scroll bar, and you try to scroll the table using the mouse wheel on a non-mac USB mouse (I've tried on a Dell USB mouse and a Logitech mouse), the SWT.Selection is not fired.  Using the trackpad or a mac mouse (bluetooth) works fine.

Snippet below.  Curiously (red herring?), scrolling via "two fingers" on a trackpad doesn't fire the MouseWheel event, but scrolling via the USB mouse does.

Tested on SWT 3621, but also present in 3.5.1 release build


Reproducible: Always

Steps to Reproduce:

	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display, SWT.SHELL_TRIM);
		shell.setLayout(new FillLayout());

		
		final Table c = new Table(shell, SWT.VIRTUAL);
		
		c.setItemCount(5000);
		
		ScrollBar bar = c.getVerticalBar();
		
		bar.addListener(SWT.Selection, new Listener() {
			public void handleEvent(Event event) {
				System.out.println(event.time + "] Selection! Top now " + c.getTopIndex());
			}
		});
		
		c.addListener(SWT.MouseWheel, new Listener() {
			public void handleEvent(Event event) {
				System.out.println(event.time + "] MouseWheel! Top now " + c.getTopIndex());
			}
		});
		
		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
Comment 1 ArronM CLA 2009-11-25 02:35:42 EST
Original description wasn't clear that this was the SWT.Selection event of the scrollbar that wasn't being fired. I've updated the bug description and added this comment for those who only read comments :)
Comment 2 Lakshmi P Shanmugam CLA 2017-07-04 07:42:39 EDT
Bug triaged, visit https://wiki.eclipse.org/SWT/Devel/Triage for more
information.
Comment 3 Eclipse Genie CLA 2020-06-20 15:52:58 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.