Project: SWT
Bug 266974 Cocoa SWT / GLCanvas Event Handling Problems
Reported: 2009-03-04 02:09:19 | Status: resolved fixed

GLCanvas does not deliver Events properly to listeners (e.g. MouseMove). See attached Snipped209 (with an added MouseMove Listener). Potential problem source: GLCanvas adds the NSOpenGLView instance to the parent's view, shoulnt it be the instances view itself? E.g, part of GLCanvas' constructor: // original: events not delivered glView.initWithFrame(parent.view.bounds(), pixelFormat, share != null ? share.glView : null); glView.setAutoresizingMask(OS.NSViewWidthSizable | OS.NSViewHeightSizable); parent.view.addSubview(glView); // working: however no auto resizing (why?) glView.initWithFrame(parent.view.bounds(), pixelFormat); glView.setAutoresizingMask(OS.NSViewWidthSizable | OS.NSViewHeightSizable); view.addSubview(glView);

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT OpenGL/cocoa/org/eclipse/swt/opengl/GLCanvas.java bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTOpenGLView.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java