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

Matthew Francis mjay.francis at gmail.com
Tue Apr 14 20:22:25 PDT 2015


 vcl/osx/salframe.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 58a3a99efec9d4bcb4ab61c41bf2feb707c8e1ef
Author: Matthew Francis <mjay.francis at gmail.com>
Date:   Sun Apr 12 23:10:58 2015 +0800

    tdf#71278 Set an invisible cursor rather than hiding the cursor
    
    Change-Id: I5ecfa01ab444148aa8d13d04f78db1c6c131a4df
    Reviewed-on: https://gerrit.libreoffice.org/15269
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 61dd536..202c2ee 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -802,6 +802,18 @@ void AquaSalFrame::ToTop(sal_uInt16 nFlags)
 
 NSCursor* AquaSalFrame::getCurrentCursor() const
 {
+    /* Create invisible cursor */
+    static NSCursor *invisibleCursor = NULL;
+    if (!invisibleCursor) {
+        NSImage *cursorImage = [[[NSImage alloc] initWithSize:NSMakeSize (16, 16)] autorelease];
+        [cursorImage lockFocus];
+        [[NSColor clearColor] set];
+        NSRectFill( NSMakeRect( 0, 0, 16, 16 ) );
+        [cursorImage unlockFocus];
+        invisibleCursor = [[NSCursor alloc] initWithImage:cursorImage
+                                                  hotSpot:NSZeroPoint];
+    }
+
     NSCursor* pCursor = nil;
     switch( mePointerStyle )
     {
@@ -825,7 +837,7 @@ NSCursor* AquaSalFrame::getCurrentCursor() const
     case POINTER_WINDOW_WSIZE:
                             pCursor = [NSCursor resizeLeftRightCursor]; break;
     case POINTER_REFHAND:   pCursor = [NSCursor pointingHandCursor];    break;
-    case POINTER_NULL:      [NSCursor hide];                            break;
+    case POINTER_NULL:      pCursor = invisibleCursor;                  break;
 
     default:
         pCursor = GetSalData()->getCursor( mePointerStyle );


More information about the Libreoffice-commits mailing list