Cocoa/Cursor: better compatibility when switching Windows/Apps

This commit is contained in:
rich2014 2023-09-20 10:23:55 +08:00
parent 0bc6614d40
commit 0ac0448fe9

View File

@ -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;