From f57bfc6f6b21043911a0f475af171f3f120888f2 Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Fri, 22 Jun 2012 17:33:46 -0400 Subject: Bug 377597 - Mac OS X cursor blinking dos not honor NSTextInsertionPointBlinkPeriod --- .../swt/internal/cocoa/FoundationFull.bridgesupport.extras | 9 +++++++++ .../Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java | 2 ++ .../Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras index f556849dd2..7b1602cdb9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport.extras @@ -1127,6 +1127,15 @@ + + + + + + + + + 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 e18fd42a20..9601f15d95 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 @@ -852,6 +852,7 @@ public static final int /*long*/ class_NSURLDownload = objc_getClass("NSURLDownl public static final int /*long*/ class_NSURLProtectionSpace = objc_getClass("NSURLProtectionSpace"); public static final int /*long*/ class_NSURLRequest = objc_getClass("NSURLRequest"); public static final int /*long*/ class_NSUndoManager = objc_getClass("NSUndoManager"); +public static final int /*long*/ class_NSUserDefaults = objc_getClass("NSUserDefaults"); public static final int /*long*/ class_NSValue = objc_getClass("NSValue"); public static final int /*long*/ class_NSView = objc_getClass("NSView"); public static final int /*long*/ class_NSWindow = objc_getClass("NSWindow"); @@ -2072,6 +2073,7 @@ public static final int /*long*/ sel_skipDescendents = sel_registerName("skipDes public static final int /*long*/ sel_smallSystemFontSize = sel_registerName("smallSystemFontSize"); public static final int /*long*/ sel_sortIndicatorRectForBounds_ = sel_registerName("sortIndicatorRectForBounds:"); public static final int /*long*/ sel_standardPreferences = sel_registerName("standardPreferences"); +public static final int /*long*/ sel_standardUserDefaults = sel_registerName("standardUserDefaults"); public static final int /*long*/ sel_standardWindowButton_ = sel_registerName("standardWindowButton:"); public static final int /*long*/ sel_startAnimation_ = sel_registerName("startAnimation:"); public static final int /*long*/ sel_state = sel_registerName("state"); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index 798f1d6189..a6b1299851 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -128,6 +128,7 @@ public class Display extends Device { boolean sendEvent; int clickCountButton, clickCount; + int blinkTime; Control currentControl, trackingControl, tooltipControl; Widget tooltipTarget; @@ -1299,7 +1300,7 @@ public static Display getCurrent () { int getCaretBlinkTime () { // checkDevice (); - return 560; + return blinkTime; } /** @@ -2224,6 +2225,10 @@ protected void init () { markedAttributes.retain (); textView.release (); + id blink = NSUserDefaults.standardUserDefaults().objectForKey(NSString.stringWith("NSTextInsertionPointBlinkPeriod")); + if (blink != null) blinkTime = (int)new NSNumber(blink).integerValue(); + if (blinkTime == 0) blinkTime = 560; + isPainting = (NSMutableArray)new NSMutableArray().alloc(); isPainting = isPainting.initWithCapacity(12); } -- cgit