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