[Libreoffice-commits] core.git: vcl/inc vcl/osx

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sat Mar 21 09:19:18 UTC 2020


 vcl/inc/osx/salframe.h |    2 ++
 vcl/osx/salframe.cxx   |   18 ++++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 7f45cbace44141e22c159dc2216fefd787e14d1f
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Fri Mar 20 23:54:54 2020 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat Mar 21 10:18:45 2020 +0100

    tdf#100706: get blink cursor delay for MacOS
    
    See https://bugs.documentfoundation.org/show_bug.cgi?id=100706#c1
    
    Change-Id: I2e471f093ce18c8716108c4ba793c2124e489295
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90850
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 4e32f806c33e..60b4e82f2540 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -95,6 +95,8 @@ public:
 
     bool                            mbGeometryDidChange;
 
+    int                             mnBlinkCursorDelay;
+
 public:
     /** Constructor
 
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index aafafe7a0c6c..b2990d3ede17 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -83,7 +83,8 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle
     mePointerStyle( PointerStyle::Arrow ),
     mnTrackingRectTag( 0 ),
     mrClippingPath( nullptr ),
-    mnICOptions( InputContextFlags::NONE )
+    mnICOptions( InputContextFlags::NONE ),
+    mnBlinkCursorDelay ( 500 )
 {
     mpParent = dynamic_cast<AquaSalFrame*>(pParent);
 
@@ -91,6 +92,19 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle
 
     SalData* pSalData = GetSalData();
     pSalData->mpInstance->insertFrame( this );
+    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+    if (userDefaults != nil)
+    {
+        id setting = [userDefaults objectForKey: @"NSTextInsertionPointBlinkPeriodOn"];
+        if (setting)
+            mnBlinkCursorDelay = [setting intValue];
+        else
+        {
+            setting = [userDefaults objectForKey: @"NSTextInsertionPointBlinkPeriodOff"];
+            if (setting)
+                mnBlinkCursorDelay = [setting intValue];
+        }
+    }
 }
 
 AquaSalFrame::~AquaSalFrame()
@@ -1306,7 +1320,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     aStyleSettings.SetTabTextColor(aControlTextColor);
     aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
 
-    aStyleSettings.SetCursorBlinkTime( 500 );
+    aStyleSettings.SetCursorBlinkTime( mnBlinkCursorDelay );
 
     // no mnemonics on macOS
     aStyleSettings.SetOptions( aStyleSettings.GetOptions() | StyleSettingsOptions::NoMnemonics );


More information about the Libreoffice-commits mailing list