Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-01-26 10:43:51 -0500
committerSilenio Quarti2012-01-26 11:11:05 -0500
commit3f70c924cd1098584afc73f8ada5786b779cb0fc (patch)
treec6c11d8a4b49fc2a03594acbee962c51fcb3bd8e
parentf517cfa1ed7e6962838e5a418cb1f6495dda0974 (diff)
downloadeclipse.platform.swt-3f70c924cd1098584afc73f8ada5786b779cb0fc.tar.gz
eclipse.platform.swt-3f70c924cd1098584afc73f8ada5786b779cb0fc.tar.xz
eclipse.platform.swt-3f70c924cd1098584afc73f8ada5786b779cb0fc.zip
Bug 369757 - [3.7.x] GLCanvas maintenance fix causes
NullPointerException when changing parent on Mac
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
index a1257fdb0f..ada4d15082 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
@@ -610,8 +610,11 @@ void viewWillMoveToWindow(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0)
super.viewWillMoveToWindow(id, sel, arg0);
if (glcontext != null) {
new NSWindow(arg0).setOpaque(false);
- NSWindow window = view.window();
- window.setOpaque(getShell().region == null);
+ Shell shell = getShell();
+ NSWindow window = shell.window;
+ if (window != null) {
+ window.setOpaque(shell.region == null);
+ }
}
}

Back to the top