diff options
author | Silenio Quarti | 2013-05-14 19:02:25 +0000 |
---|---|---|
committer | Silenio Quarti | 2013-05-14 19:03:50 +0000 |
commit | f24bd7fd329e0b2e0f5627f9224ec37a19af8b93 (patch) | |
tree | 8d8749efd7a8337079b6603eb5c02c37a0ff62dc | |
parent | 39012445fcf0cfcef5fc779422896cc4f0cfdae3 (diff) | |
download | eclipse.platform.swt-f24bd7fd329e0b2e0f5627f9224ec37a19af8b93.tar.gz eclipse.platform.swt-f24bd7fd329e0b2e0f5627f9224ec37a19af8b93.tar.xz eclipse.platform.swt-f24bd7fd329e0b2e0f5627f9224ec37a19af8b93.zip |
Bug 407555 - StackOverflowError in SWT widgets on Mac OS - backport
4 files changed, 16 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras index 2adb49b0c0..1c571015f8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras @@ -3968,6 +3968,10 @@ <arg swt_gen="true"></arg> <retval swt_gen="true" swt_java_type="NSView"></retval> </method> + <method selector="isDescendantOf:" swt_gen="true"> + <arg swt_gen="true"></arg> + <retval swt_gen="true"></retval> + </method> <method selector="isFlipped" swt_gen="true"> <retval swt_gen="true"></retval> </method> diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java index fd70c7f9bb..2b4decba75 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -178,6 +178,10 @@ public NSView initWithFrame(NSRect frameRect) { return result == this.id ? this : (result != 0 ? new NSView(result) : null); } +public boolean isDescendantOf(NSView aView) { + return OS.objc_msgSend_bool(this.id, OS.sel_isDescendantOf_, aView != null ? aView.id : 0); +} + public boolean isFlipped() { return OS.objc_msgSend_bool(this.id, OS.sel_isFlipped); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index 36b602fd24..906fe2d038 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -1430,6 +1430,7 @@ public static final int /*long*/ sel_invalidate = sel_registerName("invalidate") public static final int /*long*/ sel_invalidateShadow = sel_registerName("invalidateShadow"); public static final int /*long*/ sel_invert = sel_registerName("invert"); public static final int /*long*/ sel_isActive = sel_registerName("isActive"); +public static final int /*long*/ sel_isDescendantOf_ = sel_registerName("isDescendantOf:"); public static final int /*long*/ sel_isDocumentEdited = sel_registerName("isDocumentEdited"); public static final int /*long*/ sel_isDrawingToScreen = sel_registerName("isDrawingToScreen"); public static final int /*long*/ sel_isEmpty = sel_registerName("isEmpty"); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java index ba41cd035f..18a4730cc4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java @@ -4899,7 +4899,12 @@ public void update () { void update (boolean all) { // checkWidget(); - if (display.isPainting.containsObject(view)) return; + NSArray isPainting = display.isPainting; + if (isPainting.containsObject(view)) return; + for (int i = 0, length = (int)/*64*/isPainting.count(); i < length; i++) { + NSView view = new NSView(isPainting.objectAtIndex(i)); + if (view.isDescendantOf(this.view)) return; + } if (isResizing()) return; Shell shell = getShell(); NSWindow window = shell.deferFlushing && shell.scrolling ? view.window() : null; |