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

Bug 405053

Summary: Table - different results on Ubuntu 12.04 vs. Windows 7
Product: [Eclipse Project] Platform Reporter: Ejner Borgbjerg <ejner1>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: ericwill
Version: 3.6.2Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ejner Borgbjerg CLA 2013-04-05 18:04:37 EDT
I use the following to determine which item was right-clicked in Table:

...
		gameHeaderTable.addMouseListener(new MouseListener() {
			

			@Override
			public void mouseUp(MouseEvent event) {
			}
			
			@Override
			public void mouseDown(MouseEvent event) {
				
				if (event.button==3) {
					
					gameHeaderTableRightClickedAt = new Point (event.x, event.y);
					
					final int itemIndex = event.y / gameHeaderTable.getItemHeight();
					

Clicking on the first item in Ubuntu / Eclipse Helios / with plugins for SWT imported as binary projects - results in itemIndex = 0, which is what I want;
In Windows 7 / Eclipse Juno / with plugins for SWT imported as binary projects - results in itemIndex = 1. Either event.y or getItemHeight() (or both) must return different values on the two platforms.
Comment 1 Ejner Borgbjerg CLA 2013-04-05 18:11:27 EDT
Versions of native SWT plugins used:

org.eclipse.swt.gtk.linux.x86
3.6.2.v3659b

org.eclipse.win32.win32.x86
3.100.1.v4234e
Comment 2 Ejner Borgbjerg CLA 2013-04-05 18:20:10 EDT
I think probably better is to use a selection listener for the purpose of deciding which item was clicked, nevertheless the difference in behavior may be significant.
Comment 3 Eric Williams CLA 2018-06-15 15:08:14 EDT
(In reply to Ejner Borgbjerg from comment #2)
> I think probably better is to use a selection listener for the purpose of
> deciding which item was clicked, nevertheless the difference in behavior may
> be significant.

This is correct.