Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2016-09-29 16:53:41 -0400
committerLakshmi Shanmugam2017-03-23 08:09:26 -0400
commit528fcab722ccdaa43c8d596494e2f2799889db3c (patch)
tree58fa1a96f473d331b6f06f2daeb63b15f890779d /bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa
parent010d9d278b66159e1bb8026b19814c336766fc4f (diff)
downloadeclipse.platform.swt-528fcab722ccdaa43c8d596494e2f2799889db3c.tar.gz
eclipse.platform.swt-528fcab722ccdaa43c8d596494e2f2799889db3c.tar.xz
eclipse.platform.swt-528fcab722ccdaa43c8d596494e2f2799889db3c.zip
Bug 502711 - [Cocoa] crashes on „macOS Sierra“ related to NSCopyBits
Replaced the calls to deprecated method NSCopyBits with NSView.scrollRect() in GC.copyArea and Canvas.scroll. Removed the native code for NSCopyBits. Change-Id: I206c76cd6af9230857967fb23641f0773f90e5de Signed-off-by: Till Brychcy <register.eclipse@brychcy.de> Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java13
3 files changed, 16 insertions, 6 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 57c24c7599..7530b1df2a 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
@@ -4106,6 +4106,11 @@
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
+ <method selector="scrollRect:by:" swt_gen="true">
+ <arg swt_gen="true"></arg>
+ <arg swt_gen="true"></arg>
+ <retval swt_gen="true"></retval>
+ </method>
<method selector="scrollRectToVisible:" swt_gen="true">
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
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 5c4fb6c633..50ac015759 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
@@ -256,6 +256,10 @@ public void scrollPoint(NSPoint aPoint) {
OS.objc_msgSend(this.id, OS.sel_scrollPoint_, aPoint);
}
+public void scrollRect(NSRect aRect, NSSize delta) {
+ OS.objc_msgSend(this.id, OS.sel_scrollRect_by_, aRect, delta);
+}
+
public boolean scrollRectToVisible(NSRect aRect) {
return OS.objc_msgSend_bool(this.id, OS.sel_scrollRectToVisible_, aRect);
}
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 77d74f6ec7..94a6831620 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
@@ -1794,6 +1794,7 @@ public static final long /*int*/ sel_scrollClipView_toPoint_ = sel_registerName(
public static final long /*int*/ sel_scrollColumnToVisible_ = sel_registerName("scrollColumnToVisible:");
public static final long /*int*/ sel_scrollPoint_ = sel_registerName("scrollPoint:");
public static final long /*int*/ sel_scrollRangeToVisible_ = sel_registerName("scrollRangeToVisible:");
+public static final long /*int*/ sel_scrollRect_by_ = sel_registerName("scrollRect:by:");
public static final long /*int*/ sel_scrollRectToVisible_ = sel_registerName("scrollRectToVisible:");
public static final long /*int*/ sel_scrollRowToVisible_ = sel_registerName("scrollRowToVisible:");
public static final long /*int*/ sel_scrollToPoint_ = sel_registerName("scrollToPoint:");
@@ -3260,12 +3261,6 @@ public static final native void NSBeep();
*/
public static final native long /*int*/ NSBitsPerPixelFromDepth(int depth);
/**
- * @param srcGState cast=(NSInteger)
- * @param srcRect flags=struct
- * @param destPoint flags=struct
- */
-public static final native void NSCopyBits(long /*int*/ srcGState, NSRect srcRect, NSPoint destPoint);
-/**
* @param count cast=(NSInteger*)
*/
public static final native void NSCountWindows(long[] /*int[]*/ count);
@@ -4000,6 +3995,12 @@ public static final native long /*int*/ objc_msgSend(long /*int*/ id, long /*int
/**
* @method flags=cast
* @param arg0 flags=struct
+ * @param arg1 flags=struct
+ */
+public static final native long /*int*/ objc_msgSend(long /*int*/ id, long /*int*/ sel, NSRect arg0, NSSize arg1);
+/**
+ * @method flags=cast
+ * @param arg0 flags=struct
*/
public static final native long /*int*/ objc_msgSend(long /*int*/ id, long /*int*/ sel, NSRect arg0, boolean arg1);
/**

Back to the top