From 0ac0448fe9c8883efbe283100c19a914135d59f0 Mon Sep 17 00:00:00 2001 From: rich2014 Date: Wed, 20 Sep 2023 10:23:55 +0800 Subject: [PATCH] Cocoa/Cursor: better compatibility when switching Windows/Apps --- lcl/interfaces/cocoa/cocoawscommon.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lcl/interfaces/cocoa/cocoawscommon.pas b/lcl/interfaces/cocoa/cocoawscommon.pas index a8dd9a3939..d1699312a1 100644 --- a/lcl/interfaces/cocoa/cocoawscommon.pas +++ b/lcl/interfaces/cocoa/cocoawscommon.pas @@ -25,8 +25,8 @@ type public procedure SetNewCursor( newCursor:TCocoaCursor ); procedure ForceSetDefaultCursor; + procedure SetCursorOnActive; public - class procedure SetCursorOnActive; class procedure SetCursorAtMousePos; class procedure SetScreenCursor; class procedure SetScreenCursorWhenNotDefault; @@ -390,9 +390,9 @@ begin _lastCursor:= newCursor.Cursor; end; -class procedure TCursorHelper.SetCursorOnActive; +procedure TCursorHelper.SetCursorOnActive; begin - CursorHelper._lastCursor:= nil; + _lastCursor:= NSCursor.arrowCursor; if Screen.Cursor<>crDefault then SetScreenCursor else @@ -421,7 +421,7 @@ begin rect.origin, 0, 0, window.windowNumber, nil, 0, 0, 0); - window.lclGetCallback.MouseMove(event); + NSApp.postEvent_atStart(event, true); end; class procedure TCursorHelper.SetScreenCursor;