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

Bug 313311

Summary: [cocoa, gef] CTRL key modifier for ignoring snap does not work on Cocoa
Product: [Tools] GEF Reporter: Justin Dolezy <justin>
Component: GEF-Legacy GEF (MVC)Assignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: ahunter.eclipse
Version: unspecified   
Target Milestone: 3.6.0 (Helios) RC2   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Patch for correct Mac OS X detection ahunter.eclipse: iplog+

Description Justin Dolezy CLA 2010-05-18 05:53:24 EDT
Build Identifier: I20100312-1448

org.eclipse.gef.tools.AbstractTool has the following code:

static {
	if (SWT.getPlatform().equals("carbon"))//$NON-NLS-1$
		MODIFIER_NO_SNAPPING = SWT.CTRL;
	else
		MODIFIER_NO_SNAPPING = SWT.ALT;
}

The platform check must change to encompass Cocoa - will supply patch changing the line to:

> if (Platform.OS_MACOSX.equals(Platform.getOS())) {


Reproducible: Always

Steps to Reproduce:
1. open a GEF editor (on Cocoa) where a snap grid can be enabled and enable it
2. create an object
3. start dragging the object - it will snap to the grid regardless of whether the CTRL key is held down or now (works fine on Carbon)
Comment 1 Justin Dolezy CLA 2010-05-18 15:23:58 EDT
Created attachment 169003 [details]
Patch for correct Mac OS X detection
Comment 2 Anthony Hunter CLA 2010-05-25 11:45:42 EDT
Committed to HEAD for RC2.